This commit is contained in:
Gdpao 2020-08-06 20:46:40 +08:00
commit 2afd55f79e
19 changed files with 374 additions and 90 deletions

View File

@ -259,12 +259,13 @@ export default {
return vm.$u.post('Order/buyer_cancel', params); return vm.$u.post('Order/buyer_cancel', params);
}, },
// add_refund // add_refund
refundOrder({ order_id, goods_id, refund_amount, refund_type = 1 } = {}) { refundOrder({ order_id, goods_id, goods_num, reason_info, refund_amount } = {}) {
return vm.$u.post('order/add_refund', { return vm.$u.post('order/add_refund', {
order_id: order_id, order_id: order_id,
goods_id: goods_id, goods_id: goods_id,
refund_amount: refund_amount, refund_amount: refund_amount,
refund_type: refund_type, goods_num: goods_num,
reason_info: reason_info,
}); });
}, },
// 删除订单 // 删除订单

View File

@ -52,7 +52,7 @@ const install = (Vue, vm) => {
} else { } else {
// 如果返回false则会调用Promise的reject回调 // 如果返回false则会调用Promise的reject回调
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中res为服务端的返回值 // 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中res为服务端的返回值
return false; return res;
} }
} }

View File

@ -25,7 +25,7 @@
</view> </view>
</view> </view>
<view class="order-btn" v-if="[1, 2, 3, 4, 8].indexOf(order.view_type) >= 0"> <view class="order-btn" v-if="[1, 2, 3, 4, 8].indexOf(order.view_type) >= 0">
<view class="cancel" v-if="order.view_type == 3 || order.view_type == 2" @click="toOtherPage('RefundOrder')">申请退款</view> <view class="cancel" v-if="(order.view_type == 3 || order.view_type == 2) && order.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
<view class="cancel" v-if="order.view_type == 3" @click="toOtherPage('Logistics')">查看物流</view> <view class="cancel" v-if="order.view_type == 3" @click="toOtherPage('Logistics')">查看物流</view>
<view class="logistics" v-if="order.view_type == 3" @click="confirmReceive">确认收货</view> <view class="logistics" v-if="order.view_type == 3" @click="confirmReceive">确认收货</view>
<view class="comment" v-if="order.view_type == 4" @click="toOtherPage('Comment')">立即评价</view> <view class="comment" v-if="order.view_type == 4" @click="toOtherPage('Comment')">立即评价</view>
@ -47,7 +47,7 @@ export default {
props: { props: {
order: Object order: Object
}, },
created() { mounted() {
this.viewState(); this.viewState();
}, },
methods: { methods: {
@ -81,6 +81,7 @@ export default {
default: default:
break; break;
} }
// console.log(state);
this.state = state; this.state = state;
}, },
cancelOrder() { cancelOrder() {

View File

@ -36,6 +36,7 @@
box-sizing: border-box; box-sizing: border-box;
border-radius: 6rpx; border-radius: 6rpx;
margin-right: 26rpx; margin-right: 26rpx;
margin-bottom: 20rpx;
} }
.xuanzhong{ .xuanzhong{
border: #ff780f 1rpx solid; border: #ff780f 1rpx solid;

View File

@ -22,10 +22,17 @@
<text class="store-name">{{ goodsInfo.store_name }}</text> <text class="store-name">{{ goodsInfo.store_name }}</text>
<text class="goods-name">{{ goodsInfo.goods_name }}</text> <text class="goods-name">{{ goodsInfo.goods_name }}</text>
</view> </view>
<view class="pic"> <view class="price-collect">
<text>{{ goodsInfo.goods_price }}</text> <view class="pic" v-if="type != 3">
<s>{{ goodsInfo.goods_marketprice }}</s> <text>{{ goodsInfo.goods_price }}</text>
</view> <s>{{ goodsInfo.goods_marketprice }}</s>
</view>
<view class="collect">
<u-icon name="star" color="#474747" size="28" v-if="1"></u-icon>
<u-icon name="star-fill" color="#FF7807" size="28" v-else></u-icon>
<text>收藏</text>
</view>
</view>
</view> </view>
<view class="hr"></view> <view class="hr"></view>
<!-- <navs :value="领券"></navs> --> <!-- <navs :value="领券"></navs> -->
@ -135,11 +142,11 @@
</u-popup> </u-popup>
<!-- 普通商品 tool --> <!-- 普通商品 tool -->
<view class="tloos" v-if="type == 1"> <view class="tloos" v-if="type == 1">
<view class="navs" @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)"> <view class="navs" @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)" v-if="!showSpec">
<image src="/static/image/common/18.png"></image> <image src="/static/image/common/18.png"></image>
店铺 店铺
</view> </view>
<view class="navs" style="margin-right:30rpx"> <view class="navs" style="margin-right:30rpx" v-if="!showSpec">
<image src="/static/image/common/19.png"></image> <image src="/static/image/common/19.png"></image>
客服 客服
</view> </view>
@ -154,7 +161,7 @@
</view> </view>
<!-- 秒杀 tool --> <!-- 秒杀 tool -->
<view class="spike-tool" v-if="type==3"> <view class="spike-tool" v-if="type==3">
<view class="left"> <view class="left" v-if="!showSpec">
<view @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)"> <view @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)">
<image src="/static/image/common/18.png"></image> <image src="/static/image/common/18.png"></image>
<text>店铺</text> <text>店铺</text>
@ -222,7 +229,6 @@ export default {
// console.log(option); // console.log(option);
this.type = Number(option.type); this.type = Number(option.type);
this.id = option.id; this.id = option.id;
this.getGoodsDetails(this.id);
this.setTitle(); this.setTitle();
}, },
onShow() { onShow() {
@ -230,6 +236,7 @@ export default {
this.showSpec = false; this.showSpec = false;
this.showGroupUser = false; this.showGroupUser = false;
this.showInvolvementUser = false; this.showInvolvementUser = false;
this.getGoodsDetails(this.id);
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if(e.index == 0) this.$u.route('/pageC/cart/index'); if(e.index == 0) this.$u.route('/pageC/cart/index');
@ -331,6 +338,7 @@ export default {
this.glist = res.data.data.spec_list; this.glist = res.data.data.spec_list;
this.user_suc = res.data.data.user_suc; this.user_suc = res.data.data.user_suc;
this.groupUser =res.data.data.user; this.groupUser =res.data.data.user;
console.log(this.groupUser);
} }
}) })
}, },
@ -372,13 +380,14 @@ export default {
} }
if(this.type == 2) { if(this.type == 2) {
if(type == 'involvement') { if(type == 'involvement') {
// const userId = uni.getStorageSync('user_info').member.member_id;
this.$store.commit('setGroupHeadId', this.involvemenGroupInfo[0].user_id);
console.log(this.$store.state.pintuangroup_headid);
Object.assign(params, { Object.assign(params, {
pintuan_id: this.id, pintuan_id: this.id,
pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id, pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id,
}) })
} else { } else {
const userId = uni.getStorageSync('user_info').member.member_id;
this.$store.commit('setGroupHeadId', userId);
Object.assign(params, { Object.assign(params, {
pintuan_id: this.id, pintuan_id: this.id,
}) })
@ -563,18 +572,31 @@ export default {
line-height: 1.5; line-height: 1.5;
} }
} }
.pic{ .price-collect {
>text{ display: flex;
font-size: 32rpx; align-items: center;
color: #FF3131; justify-content: space-between;
} .pic{
>s{ >text{
font-size: 26rpx; font-size: 32rpx;
color: #999; color: #FF3131;
display: inline-block; }
margin-left: 30rpx; >s{
} font-size: 26rpx;
} color: #999;
display: inline-block;
margin-left: 30rpx;
}
}
.collect {
margin-left: auto;
display: flex;
align-items: center;
> text {
margin-left: 12rpx;
}
}
}
} }
.comment { .comment {
margin-top: 20rpx; margin-top: 20rpx;

View File

@ -179,12 +179,13 @@ export default {
let params = { let params = {
pintuan_id: this.orderInfo.pintuan_id, pintuan_id: this.orderInfo.pintuan_id,
} }
// console.log(this.involvemenGroupInfo); // console.log(this.orderInfo);
// console.log(this.$store.state.pintuangroup_headid);
if(this.orderInfo.pintuangroup_id) { if(this.orderInfo.pintuangroup_id) {
Object.assign(params, { pintuangroup_headid: this.$store.state.pintuangroup_headid }); Object.assign(params, { pintuangroup_headid: this.$store.state.pintuangroup_headid });
Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id }); Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id });
} }
// console.log(params); console.log(params);
this.$u.api.withImmediate(params).then(res => { this.$u.api.withImmediate(params).then(res => {
this.showGroupUser = false; this.showGroupUser = false;
this.showInvolvementUser = false; this.showInvolvementUser = false;
@ -200,7 +201,6 @@ export default {
if(!this.debounce) return; if(!this.debounce) return;
this.debounce = false; this.debounce = false;
if(this.orderType == 2) { if(this.orderType == 2) {
// this.sendOrder(0);
this.withImmediate(); this.withImmediate();
} else if(this.orderType == 1) { } else if(this.orderType == 1) {
this.sendOrder(0); this.sendOrder(0);
@ -256,7 +256,6 @@ export default {
// console.log(params); // console.log(params);
this.$u.api.sendOrder(params).then(res => { this.$u.api.sendOrder(params).then(res => {
if(res.errCode == 0) { if(res.errCode == 0) {
// this.withImmediate();
this.$u.route({ this.$u.route({
type: 'redirect', type: 'redirect',
url: '/pageC/cart/cashier', url: '/pageC/cart/cashier',

View File

@ -4,7 +4,7 @@
<view v-for="(store, s_index) in list" :key="s_index" class="cart-item"> <view v-for="(store, s_index) in list" :key="s_index" class="cart-item">
<view class="store"> <view class="store">
<u-checkbox v-model="store.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="s_index" @change="storeaAloneChange"></u-checkbox> <u-checkbox v-model="store.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="s_index" @change="storeaAloneChange"></u-checkbox>
<view class="name"> <view class="name" @click="viewStoreDetails(store.store_id)">
<image :src="store.store_avatar"></image> <image :src="store.store_avatar"></image>
<view>{{ store.store_name }}</view> <view>{{ store.store_name }}</view>
</view> </view>
@ -12,9 +12,9 @@
<view class="goods"> <view class="goods">
<u-checkbox-group @change="goodsChange($event, s_index)"> <u-checkbox-group @change="goodsChange($event, s_index)">
<view v-for="(goods, g_index) in store.goods" :key="g_index" class="goods-item"> <view v-for="(goods, g_index) in store.goods" :key="g_index" class="goods-item">
<u-checkbox v-model="goods.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="g_index" ></u-checkbox> <u-checkbox v-model="goods.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="g_index"></u-checkbox>
<image :src="goods.goods_image"></image> <image :src="goods.goods_image" @click="viewGoodsDetails(goods.goods_id)"></image>
<view class="info"> <view class="info" @click="viewGoodsDetails(goods.goods_id)">
<view class="name u-line-2">{{ goods.goods_name }}</view> <view class="name u-line-2">{{ goods.goods_name }}</view>
<view class="cart-info"> <view class="cart-info">
<view class="price">{{ goods.goods_price }}</view> <view class="price">{{ goods.goods_price }}</view>
@ -204,6 +204,23 @@ export default {
}) })
this.list[value[1]].checked = checked; this.list[value[1]].checked = checked;
this.storeChange(); this.storeChange();
},
viewStoreDetails(sid) {
this.$u.route({
url: 'pageC/merchant/index',
params: {
id: sid
}
})
},
viewGoodsDetails(gid) {
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: gid,
type: 1,
}
})
} }
}, },
onNavigationBarButtonTap(btn) { onNavigationBarButtonTap(btn) {

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="imageTop"> <view class="imageTop">
<image :src="url"></image> <image :src="url" mode="aspectFit"></image>
</view> </view>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="listItem"> <view class="listItem">
<video v-if="type == '2'" :src="url" :show-fullscreen-btn="true"></video> <video v-if="type == '2'" :src="url" :show-fullscreen-btn="true"></video>
<image v-else :src="url"></image> <image v-else :src="url" mode="aspectFit"></image>
</view> </view>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -14,7 +14,7 @@
</view> </view>
<scroll-view scroll-y class="scroll-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore"> <scroll-view scroll-y class="scroll-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore">
<view class="goods-container"> <view class="goods-container">
<view v-for="goods in goodsList" :key="goods.goods_id" class="goods-view" @click="toDetailsPage(goods.goods_id)"> <view v-for="(goods, index) in goodsList" :key="index" class="goods-view" @click="toDetailsPage(goods.goods_id)">
<goodsItem :info="goods"></goodsItem> <goodsItem :info="goods"></goodsItem>
</view> </view>
</view> </view>

View File

@ -37,19 +37,16 @@
</scroll-view> </scroll-view>
</view> </view>
<view class="main"> <view class="main">
<view class="video-image" v-if="cur==0 && indextop.length"> <scroll-view class="video-image" scroll-y v-if="cur==0 && indextop.length" :style="{ height: scrollHeiht }">
<view v-for="item in indextop" :key="item.id"> <view v-for="item in indextop" :key="item.id">
<videoTop :url="item.url" v-if="item.type == 2"></videoTop> <videoTop :url="item.article_pic" v-if="item.type == 2"></videoTop>
<imageTop v-else :url="item.url"></imageTop> <imageTop v-else :url="item.article_pic"></imageTop>
</view> </view>
<view style="display: flex;flex-wrap: wrap;" v-if="indexlist.length"> <view style="display: flex;flex-wrap: wrap;" v-if="indexlist.length">
<listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.url"></listitem> <listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.article_pic"></listitem>
</view> </view>
</scroll-view>
</view>
<!-- 商品筛选排序未完成 -->
<view class="item" v-if="cur==1"> <view class="item" v-if="cur==1">
<!-- <item v-for="item in list" :key="item.gc_id" :info="item" class="item"></item> -->
<goods :sid="sid"></goods> <goods :sid="sid"></goods>
</view> </view>
</view> </view>
@ -87,10 +84,12 @@ export default {
sid: '', sid: '',
show: false, show: false,
cur: 0, cur: 0,
list:[], list: [],
indexlist:[], indexlist: [],
indextop:[], indextop: [],
info:{} info: {},
page: 0,
scrollHeiht: '',
} }
}, },
components:{ components:{
@ -101,7 +100,8 @@ export default {
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getStoreInfo(); this.getStoreInfo();
this.getStoreImgVideoList(); this.getArticlelist();
// this.getStoreImgVideoList();
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
// console.log(e.index); // console.log(e.index);
@ -114,7 +114,7 @@ export default {
if(current == 0) { if(current == 0) {
this.$u.route('/pageC/merchant/storeClassify', { id: this.sid }); this.$u.route('/pageC/merchant/storeClassify', { id: this.sid });
} else if(current == 2) { } else if(current == 2) {
this.$u.route('./details', { id: this.sid }); this.$u.route('/pageC/merchant/details', { id: this.sid });
} }
}, },
getStoreInfo() { getStoreInfo() {
@ -140,12 +140,38 @@ export default {
this.$u.toast(res.message); this.$u.toast(res.message);
}) })
}, },
getArticlelist() {
this.$u.api.getArticlelist({
page: this.page,
is_video_img: 0,
store_id: this.sid,
}).then(res => {
uni.stopPullDownRefresh();
if (res.errCode == 0) {
// this.articleList = res.data.list;
if(res.data.list.length > 0) {
this.indextop = [res.data.list[0]]
this.indextop = [res.data.list[0], res.data.list[1]];
}
if(res.data.list.length > 1) {
this.indextop.push(res.data.list[1]);
this.indexlist.push(...res.data.list.slice(2,));
}
}
})
},
setViewHeight() {
const res = uni.getSystemInfoSync();
this.scrollHeiht = res.windowHeight - (73 + 20 + 170) + 'px';
}
}, },
onLoad(option){ onLoad(option){
this.sid = option.id; this.sid = option.id;
console.log(this.sid); // console.log(this.sid);
this.getStoreInfo(); this.getStoreInfo();
this.getStoreImgVideoList(); this.getArticlelist();
this.setViewHeight();
// this.getStoreImgVideoList();
} }
}; };
</script> </script>

View File

@ -193,6 +193,10 @@
sendMessage() {// sendMessage() {//
if (this.content.trim() != '') { if (this.content.trim() != '') {
this.imService.sendPrivateTextMessage(this.friend.uuid, this.content); this.imService.sendPrivateTextMessage(this.friend.uuid, this.content);
let that = this
setTimeout(function(){
that.scrollToBottom();
},500)
} }
this.content = ""; this.content = "";
}, },
@ -322,7 +326,7 @@
} }
.chatInterface .message-item{ .chatInterface .message-item{
max-height: 400rpx; /* max-height: 400rpx; */
margin-top: 40rpx; margin-top: 40rpx;
overflow: hidden; overflow: hidden;
} }
@ -342,7 +346,7 @@
.chatInterface .content{ .chatInterface .content{
font-size: 34rpx; font-size: 34rpx;
line-height: 44rpx; line-height: 44rpx;
max-height: 400rpx; /* max-height: 400rpx; */
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: right; justify-content: right;
@ -356,6 +360,7 @@
.chatInterface .content .text-content{ .chatInterface .content .text-content{
padding: 16rpx; padding: 16rpx;
border-radius: 12rpx; border-radius: 12rpx;
max-width: 520rpx;
} }
.chatInterface .content .pending{ .chatInterface .content .pending{
background: url("../images/pending.gif") no-repeat center; background: url("../images/pending.gif") no-repeat center;
@ -528,5 +533,83 @@
left: 50%; left: 50%;
margin:-20rpx; margin:-20rpx;
} }
.chatInterface .avatar{
overflow: hidden;
float: left;
}
.chatInterface .avatar img{
width: 100%;
height: 100%;
display: block;
}
.chatInterface .content{
float: left;
overflow: hidden;
}
.chatInterface .content span{
font-family: Source Han Sans CN;
letter-spacing: -0.41px;
color: #262628;
background: #efefef;
display: inline-block;
word-break: break-all;
}
.chatInterface .message-item.self{
margin-right: 0;
}
.chatInterface .message-item.self .avatar{
margin-right: 0;
float: right;
}
.chatInterface .message-item.self .content{
text-align: right;
float: right;
}
.chatInterface .message-item.self .content span{
color: #ffffff;
background:#D02129;
word-break: break-all;
text-align: left;
max-width: 520rpx;
}
.chatInterface .action-box{
background: #FAFAFA;
display: flex;
align-content: center;
align-items: center;
}
.chatInterface .message-input{
background: #efefef;
border: 0;
outline: none;
}
.chatInterface .send-message-btn{
flex-grow: 1;
text-align: center;
color: #95949A;
}
.chatInterface .member-layer{
width:100%;
height: 100%;
background: #FFFFFF;
top: 0;
left: 0;
position: absolute;
}
.member-layer .member{
display: flex;
flex-wrap: wrap;
}
.chatInterface .group-icon{
position: absolute;
}
.chatInterface .gray{
color: gray!important;
text-decoration: none!important;
}
</style> </style>

View File

@ -29,6 +29,7 @@
</view> </view>
<view class="edit-tips">注意修改手机号需要原手机号获取验证码无原手机验证码请联系客服</view> <view class="edit-tips">注意修改手机号需要原手机号获取验证码无原手机验证码请联系客服</view>
<view class="edit-btn" @click="updateMemberInfo">完成</view> <view class="edit-btn" @click="updateMemberInfo">完成</view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
@ -155,8 +156,11 @@ export default {
birthday: this.birthday, birthday: this.birthday,
}).then(res => { }).then(res => {
if (res.errCode == 0) { if (res.errCode == 0) {
this.getUserInfo(); // this.getUserInfo();
// this.$u.toast(res.message); this.$refs.uToast.show({
title: res.message,
back: true,
})
} }
}) })
}, },

View File

@ -68,7 +68,7 @@
</view> </view>
</view> </view>
<view class="btn" v-if="['1', '2', '4', '6'].indexOf(orderstate) >= 0"> <view class="btn" v-if="['1', '2', '4', '6'].indexOf(orderstate) >= 0">
<view class="cancel" v-if="orderstate == '4' || orderstate == '1'" @click="toOtherPage('RefundOrder')">申请退款</view> <view class="cancel" v-if="(orderstate == '4' || orderstate == '1') && orderInfo.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
<view class="cancel" v-if="orderstate == '1'" @click="toOtherPage('Logistics')">查看物流</view> <view class="cancel" v-if="orderstate == '1'" @click="toOtherPage('Logistics')">查看物流</view>
<view class="logistics" v-if="orderstate == '1'" @click="confirmReceive">确认收货</view> <view class="logistics" v-if="orderstate == '1'" @click="confirmReceive">确认收货</view>
<view class="comment" v-if="orderstate == '2'" @click="toOtherPage('Comment')">立即评价</view> <view class="comment" v-if="orderstate == '2'" @click="toOtherPage('Comment')">立即评价</view>

View File

@ -134,7 +134,7 @@ export default {
if(load == 'reload') this.orderList = res.data; if(load == 'reload') this.orderList = res.data;
else if(load == 'loadmore') this.orderList.push(...res.data); else if(load == 'loadmore') this.orderList.push(...res.data);
} }
return res; return res.data.length;
}, },
// //
async getAfterSaleList({ load = 'loadmore' } = {}) { async getAfterSaleList({ load = 'loadmore' } = {}) {
@ -146,7 +146,7 @@ export default {
if(load == 'reload') this.orderList = res.data; if(load == 'reload') this.orderList = res.data;
else if(load == 'loadmore') this.orderList.push(...res.data); else if(load == 'loadmore') this.orderList.push(...res.data);
} }
return res; return res.data.length;
}, },
// 穿 // 穿
async goodsTryOrderList({ load = 'loadmore' } = {}) { async goodsTryOrderList({ load = 'loadmore' } = {}) {
@ -159,7 +159,7 @@ export default {
if(load == 'reload') this.orderList = res.data.list; if(load == 'reload') this.orderList = res.data.list;
else if(load == 'loadmore') this.orderList.push(...res.data.list); else if(load == 'loadmore') this.orderList.push(...res.data.list);
} }
return res; return res.data.list.length;
}, },
reachBottom() { reachBottom() {
// 15 // 15
@ -173,9 +173,9 @@ export default {
// else // else
if(this.current == 4) promise = this.goodsTryOrderList(); if(this.current == 4) promise = this.goodsTryOrderList();
else promise = this.getOrderList(); else promise = this.getOrderList();
promise.then(res => { promise.then(length => {
this.loadStatus.splice(this.current, 1, "nomore"); this.loadStatus.splice(this.current, 1, "nomore");
if(res.data.length == 0) this.page--; if(length == 0) this.page--;
}).catch(() => { }).catch(() => {
this.loadStatus.splice(this.current, 1, "nomore"); this.loadStatus.splice(this.current, 1, "nomore");
this.page--; this.page--;

View File

@ -31,22 +31,24 @@
<view class="refund-price"> <view class="refund-price">
<view class="price"> <view class="price">
<view class="title">退款金额</view> <view class="title">退款金额</view>
<view class="value">{{ (goods.goods_pay_price * num).toFixed(2) }}</view> <view class="value">{{ totalPrice }}</view>
</view> </view>
<view class="tips">若退款成功将退还给您 {{ (goods.goods_pay_price * num).toFixed(2) }}</view> <view class="tips">若退款成功将退还给您 {{ totalPrice }}</view>
</view> </view>
<view class="refund-text"> <view class="refund-text">
<view class="title">申请说明</view> <view class="title">申请说明</view>
<u-input v-model="refundText" type="textarea" placeholder="必填,请详细说明退款理由" /> <u-input v-model="refundText" type="textarea" placeholder="必填,请详细说明退款理由" />
</view> </view>
</view> </view>
<view class="submit-btn">提交申请</view> <view class="submit-btn" @click="applyRefund">提交申请</view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
oid: '',
goodsList: [], goodsList: [],
goods: { goods: {
goods_num: 0, goods_num: 0,
@ -57,7 +59,13 @@ export default {
num: 0, num: 0,
} }
}, },
computed: {
totalPrice() {
return (this.goods.goods_pay_price * this.num).toFixed(2);
}
},
onLoad(option) { onLoad(option) {
this.oid = option.oid;
this.getOrderInfo(option.oid); this.getOrderInfo(option.oid);
}, },
methods: { methods: {
@ -81,16 +89,41 @@ export default {
// uni.stopPullDownRefresh(); // // uni.stopPullDownRefresh(); //
}) })
}, },
verifyParams() {
if(!this.goods.goods_id) {
this.$u.toast('请选择退款商品');
return false;
}
if(this.num == 0) {
this.$u.toast('请选择退款数量');
return false;
}
if(this.$u.test.isEmpty(this.refundText)) {
this.$u.toast('退款说明不可为空');
return false;
}
return true;
},
applyRefund() { applyRefund() {
if(!this.verifyParams()) return false;
let params = { let params = {
order_id: this.order.order_id, order_id: this.oid,
// goods_id: goods_id, goods_id: this.goods.goods_id,
// refund_amount: refund_amount, refund_amount: Number(this.totalPrice),
reason_info: this.refundText,
goods_num: this.num,
} }
this.$u.api.refundOrder(params).then(res => { this.$u.api.refundOrder(params).then(res => {
this.$u.toast(res.message);
if(res.errCode == 0) { if(res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
back: true,
})
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error'
})
} }
}) })
}, },

View File

@ -158,7 +158,7 @@
<view class="order-popup"> <view class="order-popup">
<view class="check"> <view class="check">
<text>选择订单</text> <text>选择订单</text>
<u-icon name="close" color="#A29FA3" size="32"></u-icon> <u-icon name="close" color="#A29FA3" size="32" @click="showPopup=false"></u-icon>
</view> </view>
<scroll-view scroll-y class="order-list"> <scroll-view scroll-y class="order-list">
<u-radio-group v-model="value" @change="radioChange"> <u-radio-group v-model="value" @change="radioChange">
@ -271,7 +271,7 @@ export default {
}) })
}, },
confirmType(e) { confirmType(e) {
console.log(e); // console.log(e);
this.type = e[0]; this.type = e[0];
}, },
async getOrderList({ load = 'reload' } = {}) { async getOrderList({ load = 'reload' } = {}) {
@ -424,6 +424,12 @@ export default {
}) })
}, },
animationfinish(e) { animationfinish(e) {
this.goodsStatus = '';
this.type = {};
this.name = '';
this.phone = '';
this.area = '';
this.address = '';
// //
this.debounce = true; this.debounce = true;
let current = e.detail.current; let current = e.detail.current;
@ -443,9 +449,6 @@ export default {
this.choose = false; this.choose = false;
} }
}, },
close(){
this.showPopup = false
},
showToast(message, type) { showToast(message, type) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: message, title: message,

View File

@ -21,7 +21,7 @@
<image :src="item.avatar"></image> <image :src="item.avatar"></image>
</view> </view>
<view class="title">{{item.name}}</view> <view class="title">{{item.name}}</view>
<view class="contentes">{{item.text}}</view> <view class="contentes u-line-1">{{item.text}}</view>
<view class="times">{{item.time}}</view> <view class="times">{{item.time}}</view>
</view> </view>
</view> </view>
@ -129,7 +129,8 @@
onFriendListChange(onlineFriends) { onFriendListChange(onlineFriends) {
//todo:UniappMAPH5H5 //todo:UniappMAPH5H5
// //
this.information_dl = this.imService.friends; console.log(onlineFriends,121212)
this.information_dl = onlineFriends;
this.$forceUpdate(); this.$forceUpdate();
}, },

View File

@ -8,14 +8,15 @@
import GoEasyIM from './goeasy-im-1.0.9'; import GoEasyIM from './goeasy-im-1.0.9';
import restApi from './restapi'; import restApi from './restapi';
function Friend(uuid, name, avatar) { function Friend(uuid, name, avatar,time = "", text = "",date = "") {
this.uuid = uuid; this.uuid = uuid;
this.name = name; this.name = name;
this.avatar = avatar; this.avatar = avatar;
this.online = false; this.online = false;
this.unReadMessage = 0; this.unReadMessage = 0;
this.text = ""; this.text = text;
this.time = ""; this.time = time;
this.date = date
} }
function Group(uuid, name, avatar) { function Group(uuid, name, avatar) {
@ -40,6 +41,7 @@ function IMService() {
this.currentUser = null; this.currentUser = null;
//我的好友 //我的好友
this.friends = {}; this.friends = {};
this.friendsarr = [];
//我的群 //我的群
this.groups = {}; this.groups = {};
//私聊消息记录map格式每个好友对应一个数组 //私聊消息记录map格式每个好友对应一个数组
@ -74,7 +76,7 @@ IMService.prototype.login = function (uuid, name, avatar) {
//初始化当前用户 //初始化当前用户
this.currentUser = new CurrentUser(uuid, name, avatar); this.currentUser = new CurrentUser(uuid, name, avatar);
//初始化联系人信息,包括群 //初始化联系人信息,包括群
// this.initialContacts(); this.initialContacts();
return true; return true;
}; };
@ -83,11 +85,56 @@ IMService.prototype.login = function (uuid, name, avatar) {
IMService.prototype.initialContacts = function (friendList) { IMService.prototype.initialContacts = function (friendList) {
//查询并初始化好友信息 //查询并初始化好友信息
// let friendList = restApi.findFriends(this.currentUser); // let friendList = restApi.findFriends(this.currentUser);
let value = uni.getStorageSync('imlist');
if(value != undefined && !value){
return ;
}
value = JSON.parse(value)
let that = this
console.log(value)
for(let i of value){
const token = uni.getStorageSync('token');
console.log(token)
uni.request({
url:"https://dmmall.sdbairui.com/api/Specialci/getAtwillUserInfo",
data:{
userId:i[0]
},
method:"POST",
header:{
"Authorization" : 'Bearer' + " " + token
},
success(res){
console.log(res)
that.friends[i[0]] = new Friend(res.data.data.member_id, res.data.data.member_nickname, res.data.data.member_avatar,i[1],i[2]);
console.log(that.friends)
let sorts = function (friends){
let paixu = function (a,b){
if(a.date > b.date){
return 0;
}else{
return 1;
}
}
friends.sort(paixu)
}
that.friendsarr = []
for(let i in that.friends){
console.log(i)
that.friendsarr.push(that.friends[i])
}
sorts(that.friendsarr)
that.onFriendListChange(that.friends);
}
})
}
//将用户列表初始化为一个map便于后续根据friendId得到friend //将用户列表初始化为一个map便于后续根据friendId得到friend
friendList.map(friend => { // friendList.map(friend => {
this.friends[friend.uuid] = new Friend(friend.uuid, friend.name, friend.avatar); // this.friends[friend.uuid] = new Friend(friend.uuid, friend.name, friend.avatar);
}); // });
//查询并初始化与自己相关的群信息 //查询并初始化与自己相关的群信息
// let groupList = restApi.findGroups(this.currentUser); // let groupList = restApi.findGroups(this.currentUser);
@ -207,6 +254,19 @@ IMService.prototype.initialIMListeners = function () {
let friend = this.friends[message.senderId]; let friend = this.friends[message.senderId];
console.log(friend) console.log(friend)
// return ; // 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 let that = this
if(!friend && friend == undefined){ if(!friend && friend == undefined){
const token = uni.getStorageSync('token'); const token = uni.getStorageSync('token');
@ -228,9 +288,24 @@ IMService.prototype.initialIMListeners = function () {
friend.unReadMessage++; friend.unReadMessage++;
friend.text = message.type != "text" ? "其他消息" : message.payload.text friend.text = message.type != "text" ? "其他消息" : message.payload.text
let time = new Date(message.timestamp) let time = new Date(message.timestamp)
friend.date = message.timestamp
friend.time = time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds() friend.time = time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds()
that.onFriendListChange(that.friends);
console.log(that.friends) 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])
}
console.log(arr)
uni.setStorageSync('imlist',JSON.stringify(arr))
that.onFriendListChange(that.friends);
} }
}) })
}else{ }else{
@ -238,12 +313,30 @@ IMService.prototype.initialIMListeners = function () {
friend.unReadMessage++; friend.unReadMessage++;
friend.text = message.type != "text" ? "其他消息" : message.payload.text friend.text = message.type != "text" ? "其他消息" : message.payload.text
let time = new Date(message.timestamp) let time = new Date(message.timestamp)
friend.date = message.timestamp
friend.time = time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds() friend.time = time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds()
this.onFriendListChange(this.friends);
console.log(this.friends) 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])
}
console.log(arr)
uni.setStorageSync('imlist',JSON.stringify(arr))
this.onFriendListChange(this.friends);
} }
// let value = uni.getStorageSync('imlist');
// value = JSON.parse(value)
// if(value.indexOf(message.senderId) == -1){
// value.unshift(message.senderId)
// }
// uni.setStorageSync('imlist',JSON.stringify(value))
} }
//更新私聊消息记录 //更新私聊消息记录
let friendId; let friendId;