18 Commits

Author SHA1 Message Date
cmxdd
9baac8ef63 update adout upload adout tencentCOS 2020-08-12 15:17:48 +08:00
cmxdd
26c2e044dc fixed bug 2020-08-11 20:37:54 +08:00
cmxdd
7cf5577cb0 fixed bug adout publish shop 2020-08-11 09:41:12 +08:00
cmx
e33e07178d Merge pull request 'cmx' (#37) from cmx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/37
2020-08-10 20:26:57 +08:00
cmxdd
9fac4e8a2e fixed bug adout shop 2020-08-10 20:24:58 +08:00
cmxdd
e223fd5ff9 Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into cmx 2020-08-10 19:06:34 +08:00
gyh
d7c6625416 Merge pull request 'GDPAO' (#36) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/36
2020-08-10 19:04:54 +08:00
Gdpao
0a8f2f815d GDPAO 2020-08-10 19:03:44 +08:00
42a08e07ba Merge pull request '防止多次点击' (#35) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/35
2020-08-10 17:38:51 +08:00
4e350f4dd0 Merge branch 'master' into xbx 2020-08-10 17:38:46 +08:00
e946b98abf 防止多次点击 2020-08-10 17:31:56 +08:00
cmxdd
2759972de6 Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into cmx 2020-08-10 16:55:34 +08:00
bee3ab9fba Merge pull request 'xbx' (#34) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/34
2020-08-10 16:48:34 +08:00
a318ea9f84 Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into xbx 2020-08-10 16:47:52 +08:00
3eaee9009a 聊天 2020-08-10 16:47:27 +08:00
cmxdd
2ab2d1c38e fixed bug 2020-08-10 15:55:21 +08:00
75a4bbedbe Merge branch 'master' of http://git.luyuan.tk/luyuan/demingshangjia into xbx 2020-08-10 14:45:35 +08:00
f89803cf9b 消息 2020-08-10 10:41:20 +08:00
16 changed files with 365 additions and 147 deletions

7
common/cos-wx-sdk-v5.js Normal file

File diff suppressed because one or more lines are too long

View File

@@ -2,14 +2,16 @@
<view class="item" @click="toDetailsPage"> <view class="item" @click="toDetailsPage">
<image :src="info.goods_pic"></image> <image :src="info.goods_pic"></image>
<view class="goods"> <view class="goods">
<view class=""> <view class="box">
<view class="boxid">
{{info.goods_try_id}}
</view>
<!-- 0:待处理订单 20:同意 40:拒绝此订单 --> <!-- 0:待处理订单 20:同意 40:拒绝此订单 -->
<view class="status" v-if="info.goods_try_order_status==0">待处理订单</view> <view class="status" v-if="info.goods_try_order_status==0">待处理订单</view>
<view class="status" v-if="info.goods_try_order_status==20">已接单订单</view> <view class="status" v-if="info.goods_try_order_status==20">已接单订单</view>
<view class="status" v-if="info.goods_try_order_status==40">已拒绝订单</view> <view class="status" v-if="info.goods_try_order_status==40">已拒绝订单</view>
<view class="status" v-if="info.goods_try_order_status==50">已完成订单</view> <view class="status" v-if="info.goods_try_order_status==50">已完成订单</view>
</view> </view>
<view class="name u-line-1">{{info.goods_name}}</view> <view class="name u-line-1">{{info.goods_name}}</view>
<view class="info"> <view class="info">
<view class="num">{{info.goods_try_num}}件商品</view> <view class="num">{{info.goods_try_num}}件商品</view>
@@ -67,7 +69,15 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
justify-content: center; justify-content: space-between;
.box{
width: 100%;
display: flex;
font-size: 24rpx;
}
.boxid{
flex: 1;
}
.status { .status {
align-self: flex-end; align-self: flex-end;
font-size: 26rpx; font-size: 26rpx;

View File

@@ -2,7 +2,7 @@
<view class="details"> <view class="details">
<view class="box" v-if="type<4"> <view class="box" v-if="type<4">
<view class="goods-info" v-for="list in info.extend_order_goods"> <view class="goods-info" v-for="list in info.extend_order_goods">
<image :src="list.goods_image"></image> <image :src="list.image_480_url"></image>
<view class="info-right"> <view class="info-right">
<view class="name u-line-1">{{ list.goods_name }}</view> <view class="name u-line-1">{{ list.goods_name }}</view>
<view class="info"> <view class="info">
@@ -39,6 +39,7 @@
<view> <view>
<view class="title">姓名</view> <view class="title">姓名</view>
<view class="value">{{ info.extend_order_common.reciver_name }}</view> <view class="value">{{ info.extend_order_common.reciver_name }}</view>
<image src="/static/image/home/chat.png" @click="tochat(info.buyer_id)"></image>
</view> </view>
<view> <view>
<view class="title">手机号</view> <view class="title">手机号</view>
@@ -79,7 +80,7 @@
<!-- 已发货 --> <!-- 已发货 -->
<view class="pushtimeline" v-if="type == 2"> <view class="pushtimeline" v-if="type == 2">
<view class="timelinetitle">物流信息</view> <view class="timelinetitle">物流信息</view>
<view class="timelineid">订单单号:{{ info.order_sn }}</view> <view class="timelineid">订单单号:&nbsp;&nbsp;&nbsp;{{ info.order_sn }}</view>
<view class="timelinebox" v-for="list in info.express_list"> <view class="timelinebox" v-for="list in info.express_list">
<view class="timelinecontent">{{list.content}}</view> <view class="timelinecontent">{{list.content}}</view>
<view class="timelinetime">{{list.kd_time}}</view> <view class="timelinetime">{{list.kd_time}}</view>
@@ -104,7 +105,8 @@
</view> </view>
<view class="btn" @click="showDelivery = false">确认</view> <view class="btn" @click="showDelivery = false">确认</view>
</u-popup> </u-popup>
<u-picker mode="selector" v-model="show" :default-selector="[0]" :range="list" range-key="content" @confirm="getselect"></u-picker> <!-- <u-picker mode="selector" v-model="show" :default-selector="[0]" :range="list" range-key="content" @confirm="getselect" confirm-color="#ff780f;"></u-picker> -->
<u-select v-model="show" :list="list" @confirm="getselect" confirm-color="#FF780F"></u-select>
<!-- companylist --> <!-- companylist -->
<u-picker <u-picker
mode="selector" mode="selector"
@@ -196,7 +198,40 @@ export default {
methods: { methods: {
// 跳转详情页面 // 跳转详情页面
tochat(ID){ tochat(ID){
function Friend(uuid, name, avatar,time = "", text = "",date = "") {
this.uuid = uuid;
this.name = name;
this.avatar = avatar;
this.online = false;
this.unReadMessage = 0;
this.text = text;
this.time = time;
this.date = date
}
console.log(ID) console.log(ID)
const token = uni.getStorageSync('token');
let that = this
uni.request({
url:"https://dmmall.sdbairui.com/api/Specialci/getAtwillUserInfo",
data:{
userId: ID
},
method:"POST",
header:{
"Authorization" : 'Bearer' + " " + token
},
success(res){
console.log(res)
res = res.data
let user = new Friend(res.data.member_id,res.data.member_nickname,res.data.member_avatar)
that.$u.route({
url:"/pages/messages/privateChat",
params:{
id:JSON.stringify(user)
}
})
}
})
}, },
// 退款单选 // 退款单选
radioGroupChange(e) { radioGroupChange(e) {
@@ -344,7 +379,7 @@ export default {
}, },
// 选择骑手 // 选择骑手
getselect(e) { getselect(e) {
this.selctcar = this.list[e[0]]; this.selctcar = this.list[e[0].value];
}, },
// 获取订单信息 // 获取订单信息
resetinfo() { resetinfo() {
@@ -371,7 +406,8 @@ export default {
} else { } else {
let arr = res.data; let arr = res.data;
for (let index in arr) { for (let index in arr) {
arr[index].content = arr[index].company_name + '——' + arr[index].contacts + '——' + arr[index].contact_number; arr[index].value = index;
arr[index].label = arr[index].company_name + ' ' + arr[index].contacts + ' ' + arr[index].contact_number;
} }
this.list = arr; this.list = arr;
} }
@@ -427,7 +463,6 @@ export default {
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
background-color: #ffffff; background-color: #ffffff;
border-bottom: 2rpx solid #ececec;
} }
.refunds-user { .refunds-user {
padding: 25rpx 30rpx; padding: 25rpx 30rpx;
@@ -493,6 +528,11 @@ export default {
} }
.value { .value {
font-size: 26rpx; font-size: 26rpx;
flex: 1;
}
image{
width: 40rpx;
height: 40rpx;
} }
} }
} }

View File

@@ -2,19 +2,7 @@
<view class="home"> <view class="home">
<view class="image-swiper"><u-swiper :list="imageList" mode="dot" border-radius="20"></u-swiper></view> <view class="image-swiper"><u-swiper :list="imageList" mode="dot" border-radius="20"></u-swiper></view>
<view class="tab-swiper"> <view class="tab-swiper">
<u-tabs-swiper <u-tabs :list="list" font-size="26" gutter="10" item-width="130" bar-width="120" active-color="#FF780F" :current="current" @change="tabsChange"></u-tabs>
ref="uTabs"
:list="list"
:current="current"
@change="tabsChange"
active-color="#FF780F"
inactive-color="#333333"
font-size="26"
height="98"
:show-bar="false"
swiperWidth="750"
gutter="52"
></u-tabs-swiper>
</view> </view>
<view class="order-list" v-if="current == 0"> <view class="order-list" v-if="current == 0">
<view v-for="(item, index) in allorder" :key="index"><OrderItem :info="item"></OrderItem></view> <view v-for="(item, index) in allorder" :key="index"><OrderItem :info="item"></OrderItem></view>
@@ -34,7 +22,7 @@
<view class="title">选择订单号</view> <view class="title">选择订单号</view>
<view class="worker" v-if="JSON.stringify(worker) != '{}'"> <view class="worker" v-if="JSON.stringify(worker) != '{}'">
<view>{{ worker.name }}</view> <view>{{ worker.name }}</view>
<u-icon name="edit-pen" @click="worker = {}"></u-icon> <u-icon name="arrow-down" @click="worker = {}"></u-icon>
</view> </view>
<view v-else class="select" @click="showSelect = true"> <view v-else class="select" @click="showSelect = true">
<view>请选择</view> <view>请选择</view>
@@ -358,6 +346,13 @@ export default {
}, },
// 骑手投诉点击确定 // 骑手投诉点击确定
setWorker(e) { setWorker(e) {
if(e[0].label==null){
this.$refs.uToast.show({
title: "选择无效",
type: 'error'
});
return
}
let arr = this.carlist; let arr = this.carlist;
for (let index in arr) { for (let index in arr) {
if (arr[index].takeawayer_id == e[0].value) { if (arr[index].takeawayer_id == e[0].value) {
@@ -402,15 +397,15 @@ export default {
} }
.complaint { .complaint {
margin: 0 30rpx; margin: 0 30rpx;
padding: 75rpx 30rpx; padding: 100rpx 20rpx;
background-color: #ffffff; background-color: #ffffff;
.select-container { .select-container {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 60rpx; margin-bottom: 100rpx;
.title { .title {
width: 180rpx; width: 150rpx;
font-size: 30rpx; font-size: 26rpx;
color: rgba(51, 51, 51, 1); color: rgba(51, 51, 51, 1);
margin-right: 20rpx; margin-right: 20rpx;
text-align: right; text-align: right;
@@ -448,8 +443,8 @@ export default {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
.title { .title {
width: 180rpx; width: 150rpx;
font-size: 30rpx; font-size: 26rpx;
text-align: right; text-align: right;
color: rgba(51, 51, 51, 1); color: rgba(51, 51, 51, 1);
margin-right: 20rpx; margin-right: 20rpx;

View File

@@ -33,7 +33,7 @@
<view> <view>
<view class="titles">标签</view> <view class="titles">标签</view>
<view class="form-view active" @click="show_add()">+ 新建标签</view> <view class="form-view active" @click="show_add()">+ 新建标签</view>
<view :class="['form-view',item.state == true ? 'active' : '']" v-for="(item, index) in fileListes" :key="index" @click="changeselect(index)"> <view :class="['form-view', item.state == true ? 'active' : '']" v-for="(item, index) in fileListes" :key="index" @click="changeselect(index)">
{{ item.name }} {{ item.name }}
</view> </view>
</view> </view>
@@ -46,10 +46,17 @@
<view class="title"><text>选择商品</text></view> <view class="title"><text>选择商品</text></view>
<!-- 商品列表 --> <!-- 商品列表 -->
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll"> <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll">
<view class="listes_shoping" v-for="(item, index) in list" :key="index" @click="checkboxChange(item.goods_id)"> <view class="listes_shoping" v-for="(item, index) in list" :key="index">
<view> <view>
<u-checkbox-group> <u-checkbox-group>
<u-checkbox shape="circle" active-color="#FF780F" v-model="item.checked" :disabled="true"></u-checkbox> <u-checkbox
shape="circle"
size="40"
active-color="#FF780F"
v-model="item.checked"
:name="index"
@change="checkboxChange"
></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
</view> </view>
<view><image :src="item.goods_image" mode="widthFix"></image></view> <view><image :src="item.goods_image" mode="widthFix"></image></view>
@@ -118,6 +125,8 @@ export default {
checked: false, checked: false,
list: [], list: [],
List_tosign: [], List_tosign: [],
flagA: true,
flagB: false,
scrollTop: 0, scrollTop: 0,
imgarr: [], //上传图片数组 imgarr: [], //上传图片数组
cover: '', //图文封面 cover: '', //图文封面
@@ -137,31 +146,34 @@ export default {
for (let index in arr) { for (let index in arr) {
newarr.push(arr[index].file_id); newarr.push(arr[index].file_id);
} }
this.$u.api.publishphoto({ console.log(this.imgarrA);
article_title: this.form.name, this.$u.api
article_content: this.form.intro, .publishphoto({
article_pic: this.imgarrA[0].file_name, article_title: this.form.name,
file_id: newarr, article_content: this.form.intro,
goods_id_arr: this.arres_list, article_pic: this.imgarrA[0].file_name,
label_arr: this.selectarr file_id: newarr,
}).then(res => { goods_id_arr: this.arres_list,
if (res.errCode != 0) { label_arr: this.selectarr
this.$refs.uToast.show({ })
title: res.message, .then(res => {
type: 'error' if (res.errCode != 0) {
}); this.$refs.uToast.show({
} else { title: res.message,
this.$refs.uToast.show({ type: 'error'
title: res.message, });
type: 'success' } else {
}); this.$refs.uToast.show({
setTimeout(function(){ title: res.message,
uni.navigateBack({ type: 'success'
delta:1 });
}) setTimeout(function() {
},1000) uni.navigateBack({
} delta: 1
}); });
}, 1000);
}
});
}, },
// 获取商品数组变化 // 获取商品数组变化
getshoplist(id) { getshoplist(id) {
@@ -175,6 +187,7 @@ export default {
} }
} }
} }
console.log(this.shoplist)
}, },
// 改变选中状态 // 改变选中状态
changeselect(num) { changeselect(num) {
@@ -207,35 +220,52 @@ export default {
}, },
// 创建标签 // 创建标签
addLiveSpec() { addLiveSpec() {
this.$u.api.createLivesp({ this.$u.api
spec_name: this.tagcontent .createLivesp({
}).then(res => { spec_name: this.tagcontent
if (res.errCode != 0) { })
this.$refs.uToast.show({ .then(res => {
title: res.message, if (res.errCode != 0) {
type: 'error' this.$refs.uToast.show({
}); title: res.message,
} else { type: 'error'
this.tagcontent = ''; });
this.show = false; } else {
this.$refs.uToast.show({ this.tagcontent = '';
title: res.message, this.show = false;
type: 'success' this.$refs.uToast.show({
}); title: res.message,
} type: 'success'
}); });
}
});
}, },
// 上传封面 // 上传封面
uploadcover(data) { uploadcover(data) {
let obj = data.data; console.log(data);
obj.url = obj.file_path; if (data.errCode != 0) {
this.imgarrA.push(obj); this.$refs.uToast.show({
title: '上传失败',
type: 'error'
});
} else {
let obj = data.data;
obj.url = obj.file_path;
this.imgarrA.push(obj);
}
}, },
// 上传图片 // 上传图片
uploadphoto(data) { uploadphoto(data) {
let obj = data.data; if (data.errCode != 0) {
obj.url = obj.file_path; this.$refs.uToast.show({
this.imgarrB.push(obj); title: '上传失败',
type: 'error'
});
} else {
let obj = data.data;
obj.url = obj.file_path;
this.imgarrB.push(obj);
}
}, },
changes() { changes() {
let that = this; let that = this;
@@ -246,16 +276,14 @@ export default {
}, },
// 选中某个复选框时由checkbox时触发 // 选中某个复选框时由checkbox时触发
checkboxChange(e) { checkboxChange(e) {
let id = e; let that = this;
for(let num in this.list){ let num =Number(e.name)
if(id==this.list[num].goods_id){ if (e.value == true) {
if(this.list[num].checked==true){ that.pushes(that.list[num].goods_id);
this.delarr(id); that.list[num].checked=true
}else{ } else {
this.pushes(id); that.delarr(that.list[num].goods_id);
} that.list[num].checked=false
this.list[num].checked = !this.list[num].checked
}
} }
}, },
// 删除直播商品 // 删除直播商品
@@ -266,7 +294,7 @@ export default {
} else { } else {
let index = that.arres_list.indexOf(id); let index = that.arres_list.indexOf(id);
that.arres_list.splice(index, 1); that.arres_list.splice(index, 1);
that.getshoplist(id); that.getshoplist();
} }
}, },
// 增加直播商品 // 增加直播商品
@@ -276,7 +304,7 @@ export default {
console.log('为空'); console.log('为空');
} else { } else {
that.arres_list.push(id); that.arres_list.push(id);
that.getshoplist(id); that.getshoplist();
} }
}, },
tosign() { tosign() {
@@ -312,7 +340,7 @@ export default {
margin: 0 auto; margin: 0 auto;
.form-view { .form-view {
background: #CDC7C8; background: #cdc7c8;
border-radius: 6rpx; border-radius: 6rpx;
margin-right: 20rpx; margin-right: 20rpx;
font-size: 24rpx; font-size: 24rpx;
@@ -322,7 +350,7 @@ export default {
color: #fff; color: #fff;
} }
.active { .active {
background: #FF780F; background: #ff780f;
} }
.scroll { .scroll {
width: 100%; width: 100%;

View File

@@ -62,7 +62,8 @@
fileListes:[], fileListes:[],
rSelect:[], rSelect:[],
image:"", image:"",
token:"" token:"",
tiaozhuan:false
}; };
}, },
methods: { methods: {
@@ -80,6 +81,7 @@
tupian(){ tupian(){
uni.hideLoading() uni.hideLoading()
}, },
sccg() {},
// 选中某个复选框时由checkbox时触发 // 选中某个复选框时由checkbox时触发
checkboxChange(e) { checkboxChange(e) {
//console.log(e); //console.log(e);
@@ -106,8 +108,11 @@
this.init() this.init()
}, },
tupian(a){ tupian(a){
console.log(JSON.parse(a.data)) // console.log(JSON.parse(a.data));
this.image = JSON.parse(a.data).data.file_name let info = JSON.parse(a.data);
console.log(info.data.file_path);
// console.log(JSON.stringify(a.data))
this.image = info.data.file_path;
}, },
navto(url){ navto(url){
this.$u.route({ this.$u.route({
@@ -115,6 +120,10 @@
}) })
}, },
kaibo(){ kaibo(){
if(this.tiaozhuan){
return ;
}
this.tiaozhuan = true
this.$u.api.createChatRoom({ this.$u.api.createChatRoom({
chat_name:this.max, chat_name:this.max,
live_desc:this.form.text, live_desc:this.form.text,
@@ -128,6 +137,7 @@
title: res.message, title: res.message,
type: 'error' type: 'error'
}); });
this.tiaozhuan = false
} }
this.$u.route({ this.$u.route({
url:"/pages/release/zhibo", url:"/pages/release/zhibo",

View File

@@ -25,7 +25,7 @@
<view> <view>
<view class="titles">标签</view> <view class="titles">标签</view>
<view class="form-view active" @click="show_add()">+ 新建标签</view> <view class="form-view active" @click="show_add()">+ 新建标签</view>
<view :class="['form-view',item.state == true ? 'active' : '']" v-for="(item, index) in fileListes" :key="index" @click="changeselect(index)"> <view :class="['form-view', item.state == true ? 'active' : '']" v-for="(item, index) in fileListes" :key="index" @click="changeselect(index)">
{{ item.name }} {{ item.name }}
</view> </view>
</view> </view>
@@ -37,10 +37,10 @@
<view class="title"><text>选择商品</text></view> <view class="title"><text>选择商品</text></view>
<!-- 商品列表 --> <!-- 商品列表 -->
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll"> <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll">
<view class="listes_shoping" v-for="(item, index) in list" :key="index" @click="checkboxChange(item.goods_id)"> <view class="listes_shoping" v-for="(item, index) in list" :key="index">
<view> <view>
<u-checkbox-group> <u-checkbox-group>
<u-checkbox shape="circle" active-color="#FF780F" v-model="item.checked" :disabled="true" ></u-checkbox> <u-checkbox shape="circle" size="40" active-color="#FF780F" v-model="item.checked" :name="index" @change="checkboxChange"></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
</view> </view>
<view><image :src="item.goods_image" mode="widthFix"></image></view> <view><image :src="item.goods_image" mode="widthFix"></image></view>
@@ -77,6 +77,75 @@
</template> </template>
<script> <script>
let COS = require('../../common/cos-wx-sdk-v5.js');
// 上传文件
const upload_file_server = (_this, filepath) => {
// 腾讯云配置
let cosConfig = {
Bucket: 'dmmall-1300406074', //replace with yours
Region: 'ap-shanghai', //replace with yours
SecretId: 'AKIDjDPJhni9gTzEB9iGNWQ3PTVGjv74q7EL', //replace with yours
SecretKey: 'ye3SZOvAQO5X5LK3Vy933h6G86h4mqpG' //replace with yours
};
// 获取本地文件
let filePath = filepath;
// 自定义文件名以及路径
let time = new Date();
var y = time.getFullYear();
var m = time.getMonth() + 1;
m = m < 10 ? '0' + m : m;
var d = time.getDate();
d = d < 10 ? '0' + d : d;
let str = y + m + d;
let Key = 'video/' + str + '/' + filePath.substr(filePath.lastIndexOf('/') + 1);
// 初始化凭证
var cos = new COS({
SecretId: cosConfig.SecretId,
SecretKey: cosConfig.SecretKey
});
//上传文件
cos.postObject(
{
Bucket: cosConfig.Bucket,
Region: cosConfig.Region,
Key: Key,
StorgeClass: 'STANDARD', //存储方式
FilePath: filePath
},
(err, data) => {
console.log(err, data, 12345);
if (err == null) {
if (data.statusCode == 200) {
_this.videopath = 'https://dmmall-1300406074.cos.ap-shanghai.myqcloud.com/' + Key;
uni.hideLoading();
_this.videostate = true;
} else {
uni.showToast({
title: '上传失败!',
icon: 'none'
});
}
} else {
return;
}
}
);
};
// 选择图片(通用)
const cImage = _this => {
uni.chooseVideo({
count: 1,
sourceType: ['camera', 'album'],
success: function(res) {
uni.showLoading({
title: '上传中'
});
const tempFilePaths = res.tempFilePath;
console.log(tempFilePaths);
upload_file_server(_this, tempFilePaths);
}
});
};
export default { export default {
data() { data() {
return { return {
@@ -106,7 +175,8 @@ export default {
selectarr: [], //选中标签 selectarr: [], //选中标签
tagcontent: '', //新建标签名字 tagcontent: '', //新建标签名字
selectvideo: '', //视频名字 selectvideo: '', //视频名字
videostate: false //视频状态 videostate: false, //视频状态
progress: 0
}; };
}, },
onLoad() { onLoad() {
@@ -150,11 +220,11 @@ export default {
title: res.message, title: res.message,
type: 'success' type: 'success'
}); });
setTimeout(function(){ setTimeout(function() {
uni.navigateBack({ uni.navigateBack({
delta:1 delta: 1
}) });
},1000) }, 1000);
} }
}); });
}, },
@@ -228,37 +298,7 @@ export default {
}, },
// 上传视频 // 上传视频
uploadvideo() { uploadvideo() {
let url = this.action; cImage(this);
let that = this;
uni.chooseVideo({
count: 1,
sourceType: ['camera', 'album'],
success: function(res) {
that.src = res.tempFilePath;
const tempFilePaths = res.tempFilePath;
uni.uploadFile({
url: url, //仅为示例,非真实的接口地址
filePath: tempFilePaths,
name: 'article_video',
formData: {
name: 'article_video'
},
header: {
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
},
success: uploadFileRes => {
console.log(uploadFileRes);
let obj = JSON.parse(uploadFileRes.data);
that.videopath = obj.data.url;
that.selectvideo = obj.data.key;
that.videostate = true;
},
fail: function(error) {
console.log(error);
}
});
}
});
}, },
// 新建标签 // 新建标签
show_add() { show_add() {
@@ -271,15 +311,14 @@ export default {
}, },
// 选中某个复选框时由checkbox时触发 // 选中某个复选框时由checkbox时触发
checkboxChange(e) { checkboxChange(e) {
for(let num in this.list){ let that = this;
if(id==this.list[num].goods_id){ let num = Number(e.name);
if(this.list[num].checked==true){ if (e.value == true) {
this.delarr(id); that.pushes(that.list[num].goods_id);
}else{ that.list[num].checked = true;
this.pushes(id); } else {
} that.delarr(that.list[num].goods_id);
this.list[num].checked = !this.list[num].checked that.list[num].checked = false;
}
} }
}, },
// 删除直播商品 // 删除直播商品
@@ -438,7 +477,7 @@ export default {
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
} }
.form-view { .form-view {
background: #CDC7C8; background: #cdc7c8;
border-radius: 6rpx; border-radius: 6rpx;
margin-right: 20rpx; margin-right: 20rpx;
font-size: 24rpx; font-size: 24rpx;
@@ -448,7 +487,7 @@ export default {
color: #fff; color: #fff;
} }
.active { .active {
background: #FF780F; background: #ff780f;
} }
.titles { .titles {
font-size: 30rpx; font-size: 30rpx;

View File

@@ -57,6 +57,9 @@ export default {
title: res.message, title: res.message,
type: 'success' type: 'success'
}); });
uni.navigateBack({
delta:1
})
} }
}); });
}, },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 723 B

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 805 B

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 774 B

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 841 B

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 753 B

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 761 B

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 705 B

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -386,7 +386,85 @@ IMService.prototype.initialIMListeners = function () {
// }) // })
}; };
IMService.prototype.sendMessagesSetStorage = function (friendId,message){
let friend = this.friends[friendId];
console.log(friend)
// return ;
let sorts = function (friends){
let paixu = function (a,b){
if(a.date > b.date){
return 0;
}else{
return 1;
}
}
friends.sort(paixu)
}
let that = this
if(!friend && friend == undefined){
const token = uni.getStorageSync('token');
console.log(token)
uni.request({
url:"https://dmmall.sdbairui.com/api/Specialci/getAtwillUserInfo",
data:{
userId:friendId
},
method:"POST",
header:{
"Authorization" : 'Bearer' + " " + token
},
success(res){
console.log(res)
that.friends[friendId] = new Friend(res.data.data.member_id, res.data.data.member_nickname, res.data.data.member_avatar);
friend = that.friends[friendId];
console.log(friend)
friend.text = message
let time = new Date()
friend.date = time.getTime()
friend.time = time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds()
console.log(that.friends)
that.friendsarr = []
for(let i in that.friends){
console.log(i)
that.friendsarr.push(that.friends[i])
}
sorts(that.friendsarr)
let arr = []
for(let i in that.friends){
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,0])
}
console.log(arr)
uni.setStorageSync('imlist',JSON.stringify(arr))
that.onFriendListChange(that.friends);
}
})
}else{
console.log(friend)
friend.text = message
let time = new Date()
friend.date = time.getTime()
friend.time = time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds()
console.log(this.friends)
that.friendsarr = []
for(let i in this.friends){
that.friendsarr.push(this.friends[i])
}
sorts(that.friendsarr)
let arr = []
for(let i in that.friends){
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,0])
}
console.log(arr)
uni.setStorageSync('imlist',JSON.stringify(arr))
this.onFriendListChange(this.friends);
}
}
//订阅群消息 //订阅群消息
IMService.prototype.subscribeGroupMessage = function (id) { IMService.prototype.subscribeGroupMessage = function (id) {
this.im.subscribeGroup([id]) this.im.subscribeGroup([id])
@@ -462,6 +540,8 @@ IMService.prototype.sendPrivateTextMessage = function (friendId, text) {
text: text text: text
}); });
this.sendPrivateMessage(friendId, textMessage); this.sendPrivateMessage(friendId, textMessage);
this.sendMessagesSetStorage(friendId, text)
}; };
//私聊图片消息 //私聊图片消息
@@ -473,6 +553,8 @@ IMService.prototype.sendPrivateImageMessage = function (friendId, imageFile) {
} }
}); });
this.sendPrivateMessage(friendId, imageMessage); this.sendPrivateMessage(friendId, imageMessage);
this.sendMessagesSetStorage(friendId, '其他消息')
}; };
//私聊视频消息 //私聊视频消息
@@ -484,6 +566,8 @@ IMService.prototype.sendPrivateVideoMessage = function (friendId, videoFile) {
} }
}); });
this.sendPrivateMessage(friendId, videoMessage); this.sendPrivateMessage(friendId, videoMessage);
this.sendMessagesSetStorage(friendId, '其他消息')
}; };
IMService.prototype.sendPrivateAudioMessage = function (friendId, audiofile) { IMService.prototype.sendPrivateAudioMessage = function (friendId, audiofile) {
@@ -495,6 +579,8 @@ IMService.prototype.sendPrivateAudioMessage = function (friendId, audiofile) {
}); });
this.sendPrivateMessage(friendId, audioMessage); this.sendPrivateMessage(friendId, audioMessage);
this.sendMessagesSetStorage(friendId, '其他消息')
}; };
//发送私聊消息 //发送私聊消息