mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-20 01:15:53 +08:00
Compare commits
55 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4400e406f6 | ||
|
|
78f81a8407 | ||
|
|
d166d5943c | ||
|
|
c0e5d75cc6 | ||
|
|
9195bcdeb5 | ||
|
|
7778a62d6a | ||
|
|
31c341148f | ||
|
|
0b601e4f3e | ||
|
|
1d93d9103d | ||
|
|
5bc5152e49 | ||
|
|
e9d1a81612 | ||
|
|
7d3d06e8af | ||
|
|
55bb6ab51a | ||
|
|
70c2e68bff | ||
|
|
17287df293 | ||
|
|
a8d321c66d | ||
|
|
fad004aed5 | ||
|
|
fe9060073f | ||
|
|
393c60200f | ||
|
|
e61222928e | ||
|
|
b51caa9135 | ||
|
|
992bb76072 | ||
|
|
863315eaed | ||
|
|
52bf47e358 | ||
|
|
8f49dce8f0 | ||
|
|
4490a4119e | ||
|
|
2d0b78af52 | ||
|
|
7148b32c43 | ||
|
|
20b2ca04f0 | ||
|
|
25677ced97 | ||
|
|
4517c9562a | ||
|
|
2634017fb3 | ||
|
|
b69c7d5a05 | ||
|
|
098bee9bb4 | ||
|
|
2d369ad729 | ||
|
|
3bf0be98cb | ||
|
|
1046a1052e | ||
|
|
1cc6cc4ac7 | ||
|
|
dae3e74a60 | ||
|
|
fddceb5f36 | ||
|
|
2aed3b9305 | ||
|
|
101aa279d8 | ||
|
|
abbadfbab1 | ||
|
|
8ad76a5278 | ||
|
|
726a85e76c | ||
|
|
2d69967f51 | ||
|
|
4aeaa115dc | ||
|
|
2d251faff1 | ||
|
|
231936c91d | ||
|
|
37b8e17cba | ||
|
|
7d928e3df9 | ||
|
|
bb4435fab4 | ||
|
|
1e0580ba15 | ||
|
|
f5716c901d | ||
|
|
2c4c0ea4f0 |
26
App.vue
26
App.vue
@@ -2,15 +2,15 @@
|
||||
/**
|
||||
* vuex管理登录状态,具体可以参考官方登录模板示例
|
||||
*/
|
||||
import {
|
||||
mapMutations
|
||||
} from "vuex";
|
||||
import APPUpdate from "@/plugins/APPUpdate";
|
||||
import {
|
||||
getClipboardData
|
||||
} from "@/js_sdk/h5-copy/h5-copy.js";
|
||||
import config from "@/config/config";
|
||||
import storage from "@/utils/storage";
|
||||
import {
|
||||
getClipboardData
|
||||
} from "@/js_sdk/h5-copy/h5-copy.js";
|
||||
import APPUpdate from "@/plugins/APPUpdate";
|
||||
import storage from "@/utils/storage";
|
||||
import {
|
||||
mapMutations
|
||||
} from "vuex";
|
||||
|
||||
|
||||
|
||||
@@ -20,14 +20,7 @@
|
||||
* */
|
||||
// #ifdef MP-WEIXIN
|
||||
wx.onAppRoute((res) => {
|
||||
const pages = getCurrentPages();
|
||||
console.log("pages:" + pages.length,pages);
|
||||
if (pages.length > 3) {
|
||||
delete getCurrentPages()[2]
|
||||
}
|
||||
console.log('路由监听', {
|
||||
res
|
||||
})
|
||||
|
||||
})
|
||||
// #endif
|
||||
|
||||
@@ -43,6 +36,7 @@
|
||||
* 监听返回
|
||||
*/
|
||||
onBackPress(e) {
|
||||
console.log("onBackPress-APP", e);
|
||||
if (e.from == "backbutton") {
|
||||
let routes = getCurrentPages();
|
||||
let curRoute = routes[routes.length - 1].options;
|
||||
|
||||
@@ -12,6 +12,12 @@
|
||||
|
||||

|
||||
|
||||
## lilishop-uniapp如何在本地h5和微信小程序中运行
|
||||
https://www.bilibili.com/video/BV17K8EemEh2/
|
||||
|
||||
## lilishop-uniapp如何打包h5到服务器
|
||||
https://www.bilibili.com/video/BV1CX87exE64/
|
||||
|
||||
### 快速开始
|
||||
|
||||
#### 阅读文档
|
||||
|
||||
@@ -218,3 +218,13 @@ export function fillShipInfo(afterSaleSn, params) {
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
// 添加交易投诉对话
|
||||
export function communication(params) {
|
||||
return http.request({
|
||||
url: `/order/complain/communication`,
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
params
|
||||
});
|
||||
}
|
||||
11
api/im.js
11
api/im.js
@@ -2,6 +2,17 @@ import { http,Method } from "@/utils/request.js";
|
||||
|
||||
import api from "@/config/api.js";
|
||||
|
||||
|
||||
|
||||
export function getImSetting() {
|
||||
return http.request({
|
||||
url: `/other/setting/get/IM_SETTING`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取聊天详情接口
|
||||
* @param {*} talkId
|
||||
|
||||
20
api/login.js
20
api/login.js
@@ -14,6 +14,17 @@ export function resetByMobile(params) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定手机号码
|
||||
* @param mobile
|
||||
*/
|
||||
export function bindMobile(params) {
|
||||
return http.request({
|
||||
url: `/passport/member/bindMobile`,
|
||||
method: "POST",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
//获取自动发券
|
||||
export function getAutoCoup(){
|
||||
@@ -119,3 +130,12 @@ export function scannerCodeLoginConfirm(params){
|
||||
needToken: true,
|
||||
});
|
||||
}
|
||||
|
||||
// 注销用户
|
||||
export function logoffConfirm() {
|
||||
return http.request({
|
||||
url: '/passport/member/cancellation',
|
||||
method: "PUT",
|
||||
needToken: true,
|
||||
})
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export function getMessages(params) {
|
||||
*/
|
||||
export function messageMarkAsRead(ids) {
|
||||
return http.request({
|
||||
url: `members/member-nocice-logs/${ids}/read`,
|
||||
url: `/message/member/${ids}`,
|
||||
method: Method.PUT,
|
||||
needToken: true,
|
||||
});
|
||||
|
||||
@@ -319,3 +319,12 @@ export function reBuy(sn) {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 查看包裹列表
|
||||
export function getPackage(orderSn) {
|
||||
return http.request({
|
||||
url: `/order/order/getPackage/${orderSn}`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
}
|
||||
@@ -93,14 +93,17 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<div class="soldout" v-if="goodsDetail.quantity === 0">
|
||||
<u-alert-tips type="warning" title="商品已售罄" description="当前商品库存为0"></u-alert-tips>
|
||||
</div>
|
||||
<!-- 数量 -->
|
||||
<view class="goods-skus-number flex flex-a-c flex-j-sb">
|
||||
<view v-if="goodsDetail.quantity !== 0" class="goods-skus-number flex flex-a-c flex-j-sb">
|
||||
<view class="view-class-title">数量</view>
|
||||
<uni-number-box class="uNumber" :min="1" :max="999" v-model="num"></uni-number-box>
|
||||
<uni-number-box class="uNumber" :min="1" :max="999" :disabled="goodsDetail.quantity === 0" v-model="num"></uni-number-box>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 按钮 -->
|
||||
<view class="btns">
|
||||
<view class="btns" v-if="goodsDetail.quantity !== 0">
|
||||
<view class="box-btn card" v-if="buyType != 'PINTUAN' && goodsDetail.goodsType != 'VIRTUAL_GOODS'" @click="addToCartOrBuy('cart')">加入购物车</view>
|
||||
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
||||
</view>
|
||||
@@ -209,6 +212,18 @@ export default {
|
||||
this.$emit('changed', val);
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
'goodsDetail.quantity': {
|
||||
handler(val) {
|
||||
if (val == 0) {
|
||||
uni.showToast({
|
||||
title: '商品已售罄',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
})
|
||||
this.num = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -400,6 +415,8 @@ export default {
|
||||
|
||||
mounted() {
|
||||
this.formatSku(this.goodsSpec);
|
||||
|
||||
console.log("goodsDetail",this.goodsDetail)
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -460,6 +477,9 @@ export default {
|
||||
// #endif
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.soldout{
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
|
||||
.goods-skus-view {
|
||||
overflow: hidden;
|
||||
|
||||
@@ -180,6 +180,7 @@ export default {
|
||||
if (this.tabbars[index].id != item.id) {
|
||||
this.tabbars[index].localName = item.name;
|
||||
this.tabbars[index].id = item.id;
|
||||
this.tabbars[index].center = item.center
|
||||
if (index < this.tabbars.length - 1) {
|
||||
this.tabbars.splice(index + 1, this.tabbars.length - index - 1);
|
||||
}
|
||||
@@ -195,6 +196,7 @@ export default {
|
||||
localName: "请选择",
|
||||
id: "",
|
||||
children: data.data.result,
|
||||
|
||||
};
|
||||
this.tabbars.push(current);
|
||||
this.tabCurrentIndex++;
|
||||
@@ -387,4 +389,4 @@ export default {
|
||||
icon {
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -32,26 +32,7 @@
|
||||
<span>已售 {{ item.buyCount || "0" }}</span>
|
||||
<span>{{ item.commentNum || "0" }}条评论</span>
|
||||
</div>
|
||||
<div
|
||||
class="store-seller-name"
|
||||
v-if="storeName"
|
||||
@click="navigateToStoreDetailPage(item)"
|
||||
>
|
||||
<div class="text-hidden">
|
||||
<u-tag
|
||||
style="margin-right: 10rpx"
|
||||
size="mini"
|
||||
mode="dark"
|
||||
v-if="item.selfOperated"
|
||||
text="自营"
|
||||
type="error"
|
||||
/>
|
||||
<span>{{ item.storeName || "暂无" }}</span>
|
||||
</div>
|
||||
<span>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -34,16 +34,7 @@
|
||||
<span>已售 {{ item.buyCount || "0" }}</span>
|
||||
<span>{{ item.commentNum || "0" }}条评论</span>
|
||||
</div>
|
||||
<div class="store-seller-name" v-if="storeName" @click="navigateToStoreDetailPage(item)">
|
||||
<div class="text-hidden">
|
||||
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated"
|
||||
text="自营" type="error" />
|
||||
<span>{{ item.storeName || "暂无" }}</span>
|
||||
</div>
|
||||
<span>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -79,18 +70,7 @@
|
||||
<span style="float: left; font-size: 22rpx">已售 {{ item.buyCount || '0' }}</span>
|
||||
<span style="float: right; font-size: 22rpx">{{ item.commentNum || '0' }}条评论</span>
|
||||
</div>
|
||||
<div style="overflow: hidden" @click="navigateToStoreDetailPage(item)" class="count-config">
|
||||
<div class="text-hidden" v-if="storeName">
|
||||
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated"
|
||||
text="自营" type="error" />
|
||||
<span class="line1-store-name">{{ item.storeName }}</span>
|
||||
<span class="to-store">进店<u-icon size="24" name="arrow-right" color="#666"></u-icon>
|
||||
</span>
|
||||
</div>
|
||||
<span>
|
||||
<u-icon name="arrow-right" color="#c5c5c5"></u-icon>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
}}
|
||||
</div>
|
||||
<!-- 兜底策略如果金额是0 -->
|
||||
<div class="price" v-if="!item.price">
|
||||
<div class="price" v-if="!item.price && !type">
|
||||
¥<span>0 </span>.00
|
||||
</div>
|
||||
</view>
|
||||
|
||||
@@ -121,7 +121,15 @@ export default {
|
||||
* 回退到上一级
|
||||
*/
|
||||
onClickLeft() {
|
||||
uni.navigateBack();
|
||||
const paths = getCurrentPages();
|
||||
console.log(paths)
|
||||
if(paths.length > 1){
|
||||
uni.navigateBack();
|
||||
}else{
|
||||
uni.switchTab({
|
||||
url:"/pages/tabbar/home/index"
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
* @param {sn,price}
|
||||
*/
|
||||
|
||||
import { initiatePay } from "@/api/trade";
|
||||
import { getWeChatMpMessage } from "@/api/message.js";
|
||||
import { initiatePay } from "@/api/trade";
|
||||
class LiLiWXPay {
|
||||
constructor(...payList) {
|
||||
this.data = payList[0];
|
||||
@@ -65,52 +65,40 @@ class LiLiWXPay {
|
||||
}
|
||||
|
||||
function sendMessage(price) {
|
||||
//判断用户是否已经进行了订阅
|
||||
if (!uni.getStorageSync("acceptSubscribeMessage")) {
|
||||
//订阅消息
|
||||
getWeChatMpMessage().then((res) => {
|
||||
var message = res.data.result;
|
||||
var templateid = message.map((item) => item.code);
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: templateid,
|
||||
success: (res) => {
|
||||
for (let key in res) {
|
||||
// 表示用户拒绝订阅该信息
|
||||
if (res[key] == "reject") {
|
||||
this.checked = false;
|
||||
} else {
|
||||
uni.setStorageSync("acceptSubscribeMessage", res);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.removeStorageSync("acceptSubscribeMessage");
|
||||
this.checked = false;
|
||||
},
|
||||
complete: () => {
|
||||
/**
|
||||
* 已经支付成功
|
||||
*/
|
||||
uni.redirectTo({
|
||||
url:
|
||||
"/pages/cart/payment/success?paymentMethod=WECHAT" +
|
||||
"&payPrice=" +
|
||||
price,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
//订阅消息
|
||||
getWeChatMpMessage().then((res) => {
|
||||
var message = res.data.result;
|
||||
var templateid = message.map((item) => item.code);
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: templateid,
|
||||
success: (res) => {
|
||||
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log('fail', res)
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "订阅消息失败",
|
||||
})
|
||||
},
|
||||
complete: (res) => {
|
||||
console.log('complete', res)
|
||||
|
||||
/**
|
||||
* 已经支付成功
|
||||
*/
|
||||
uni.redirectTo({
|
||||
url:
|
||||
"/pages/cart/payment/success?paymentMethod=WECHAT" +
|
||||
"&payPrice=" +
|
||||
price,
|
||||
});
|
||||
},
|
||||
});
|
||||
} else {
|
||||
/**
|
||||
* 已经支付成功
|
||||
*/
|
||||
uni.redirectTo({
|
||||
url:
|
||||
"/pages/cart/payment/success?paymentMethod=WECHAT" +
|
||||
"&payPrice=" +
|
||||
price,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
export default LiLiWXPay;
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
},
|
||||
"apple" : {},
|
||||
"qq" : {
|
||||
"appid" : "101918501"
|
||||
"appid" : "101918503"
|
||||
}
|
||||
},
|
||||
"geolocation" : {
|
||||
@@ -206,12 +206,12 @@
|
||||
"desc" : "位置信息将用于高德地图的效果展示"
|
||||
}
|
||||
},
|
||||
"plugins" : {
|
||||
"live-player-plugin" : {
|
||||
"version" : "1.3.0",
|
||||
"provider" : "wx2b03c6e691cd7370"
|
||||
}
|
||||
},
|
||||
"plugins" : {},
|
||||
// 直播插件注释
|
||||
// "live-player-plugin" : {
|
||||
// "version" : "1.3.0",
|
||||
// "provider" : "wx2b03c6e691cd7370"
|
||||
// }
|
||||
"requiredPrivateInfos" : [ "chooseLocation", "getLocation" ]
|
||||
},
|
||||
"h5" : {
|
||||
|
||||
23
pages.json
23
pages.json
@@ -36,6 +36,7 @@
|
||||
"path": "pages/tabbar/cart/cartList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "购物车",
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
"navigationBarBackgroundColor": "#fff",
|
||||
"enablePullDownRefresh":true //实现下拉刷新样式
|
||||
|
||||
@@ -274,6 +275,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "set/securityCenter/bindMobile",
|
||||
"style": {
|
||||
"navigationBarTitleText": "绑定手机号",
|
||||
"app-plus": {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "im/list",
|
||||
@@ -388,7 +399,7 @@
|
||||
"pages": [{
|
||||
"path": "shopPage",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarTitleText": "店铺详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
@@ -531,7 +542,7 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "限时抢购",
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
"navigationBarTextStyle": "white" ,
|
||||
"navigationBarTextStyle": "black" ,
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"homeButton":true
|
||||
@@ -545,7 +556,7 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "拼团活动",
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
"navigationBarTextStyle": "white" ,
|
||||
"navigationBarTextStyle": "black" ,
|
||||
"app-plus": {
|
||||
// 将回弹属性关掉
|
||||
"bounce": "none"
|
||||
@@ -707,6 +718,12 @@
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "deliverDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "物流详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "evaluate/evaluateDetail",
|
||||
"style": {
|
||||
|
||||
@@ -17,8 +17,10 @@
|
||||
<view class="text">• 使用范围:{{
|
||||
coupon.scopeType == 'ALL' && coupon.storeId == '0'
|
||||
? "全平台"
|
||||
: coupon.scopeType == "PORTION_CATEGORY"
|
||||
? "仅限品类"
|
||||
: coupon.scopeType == "PORTION_GOODS"
|
||||
? "部分商品"
|
||||
: coupon.scopeType == "PORTION_GOODS_CATEGORY"
|
||||
? "部分分类商品"
|
||||
: coupon.storeName == 'platform' ? '全平台' :coupon.storeName+''
|
||||
}}使用</view>
|
||||
<view class="text">• 有效期至:{{coupon.endTime}}</view>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<text>立即</text><br />
|
||||
<text>使用</text>
|
||||
</view>
|
||||
<view class="used" v-else @click="clickWay(item)">
|
||||
<view class="used" v-if="current == 0 && routerVal.selectedCoupon.includes(item.id)" @click="clickWay(item)">
|
||||
<text>取消</text><br />
|
||||
<text>使用</text>
|
||||
</view>
|
||||
|
||||
@@ -70,8 +70,10 @@
|
||||
>使用范围:{{
|
||||
coupon.scopeType == "ALL" && coupon.storeId == "0"
|
||||
? "全平台"
|
||||
: coupon.scopeType == "PORTION_CATEGORY"
|
||||
? "仅限品类"
|
||||
: coupon.scopeType == "PORTION_GOODS"
|
||||
? "部分商品"
|
||||
: coupon.scopeType == "PORTION_GOODS_CATEGORY"
|
||||
? "部分分类商品"
|
||||
: coupon.storeName == "platform"
|
||||
? "全平台"
|
||||
: coupon.storeName + ""
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
¥{{ Number(payPrice) | unitPrice }}
|
||||
</div>
|
||||
<div class="pay-btns">
|
||||
<div v-show="!from" @click="checkOrder">查看{{this.orderType == "RECHARGE" ? '余额' : '订单'}}</div>
|
||||
<div v-show="!from" @click="checkOrder">查看{{ this.orderType == "RECHARGE" ? '余额' : '订单' }}</div>
|
||||
<div @click="navigateTo('/pages/tabbar/home/index', 'switch')">回到首页</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -16,7 +16,7 @@
|
||||
<div>
|
||||
支付方式:
|
||||
</div>
|
||||
<div>{{paymentMethod | paymentTypeFilter}}</div>
|
||||
<div>{{ paymentMethod | paymentTypeFilter }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -60,7 +60,7 @@ export default {
|
||||
this.from = options.from || "";
|
||||
this.payPrice = options.payPrice || 0;
|
||||
this.orderType = options.orderType;
|
||||
// this.sendMessage()
|
||||
|
||||
},
|
||||
methods: {
|
||||
checkOrder() {
|
||||
@@ -77,11 +77,6 @@ export default {
|
||||
this.navigateTo("/pages/order/myOrder?status=0");
|
||||
}
|
||||
},
|
||||
changeStatus(val) {
|
||||
if (val) {
|
||||
this.sendMessage();
|
||||
}
|
||||
},
|
||||
|
||||
navigateTo(url, type) {
|
||||
if (type === "switch") {
|
||||
@@ -105,6 +100,7 @@ export default {
|
||||
padding: 0 20rpx 20rpx;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.pay-btns {
|
||||
display: flex;
|
||||
width: 50%;
|
||||
@@ -112,7 +108,7 @@ export default {
|
||||
margin: 0 auto;
|
||||
color: #fff;
|
||||
|
||||
> div {
|
||||
>div {
|
||||
padding: 6px 12px;
|
||||
border: 1px solid #fff;
|
||||
border-radius: 100px;
|
||||
@@ -146,7 +142,7 @@ export default {
|
||||
border-radius: 20rpx;
|
||||
background: rgba($color: $main-color, $alpha: 0.2);
|
||||
|
||||
> h2 {
|
||||
>h2 {
|
||||
margin-top: 20rpx;
|
||||
font-size: 40rpx;
|
||||
color: $main-color;
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
<u-input v-model="form.mobile" type="number" maxlength="11" placeholder="请输入收货人手机号码" />
|
||||
</u-form-item>
|
||||
<u-form-item label="所在区域" label-width="130" prop="___path">
|
||||
<u-input v-model="form.___path" type="select" @click="showPicker" placeholder="请选择所在地区" />
|
||||
<div @click="showPicker" >
|
||||
{{ form.___path || '请选择所在地区' }}
|
||||
</div>
|
||||
</u-form-item>
|
||||
<u-form-item class="detailAddress" label="详细地址" label-width="130" prop="detail">
|
||||
<u-input type="textarea" v-model="form.detail" maxlength="100" height="150" placeholder="街道楼牌号等" />
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
</view>
|
||||
<view class="log-item-view">
|
||||
<view>创建时间:{{ item.createTime }}</view>
|
||||
<view>店铺:{{ item.storeName }}</view>
|
||||
</view>
|
||||
<view class="log-item-footer">
|
||||
<view>会员名称:{{ item.memberName }}</view>
|
||||
|
||||
@@ -66,42 +66,45 @@
|
||||
<!-- 商品列表 -->
|
||||
|
||||
<view class="goods-list">
|
||||
<u-swipe-action v-for="(item, index) in goodsList" :disabled="!params.checked" :show="item.___selected" @open="openAction(item)" :index="index" :options="options" bg-color="#fff"
|
||||
ref="swiperAction" :key="item.id" @click="changeActionTab(item)">
|
||||
<scroll-view class="body-view" scroll-y @scrolltolower="renderDate">
|
||||
<u-swipe-action v-for="(item, index) in goodsList" :disabled="!params.checked" :show="item.___selected" @open="openAction(item)" :index="index" :options="options" bg-color="#fff"
|
||||
ref="swiperAction" :key="item.id" @click="changeActionTab(item)">
|
||||
|
||||
<div class="goods-item">
|
||||
<view class="goods-item-img" @click="handleNavgationGoods(item)">
|
||||
<u-image width="176rpx" height="176rpx" :src="item.thumbnail"></u-image>
|
||||
</view>
|
||||
<view class="goods-item-desc">
|
||||
<!-- 商品描述 -->
|
||||
<view class="-item-title" @click="handleNavgationGoods(item)">
|
||||
{{ item.goodsName }}
|
||||
<div class="goods-item">
|
||||
<view class="goods-item-img" @click="handleNavgationGoods(item)">
|
||||
<u-image width="176rpx" height="176rpx" :src="item.thumbnail"></u-image>
|
||||
</view>
|
||||
<!-- 商品金额 -->
|
||||
<view class="-item-price" @click="handleNavgationGoods(item)">
|
||||
佣金:
|
||||
<span> ¥{{ item.commission | unitPrice }}</span>
|
||||
</view>
|
||||
<!-- 比率佣金 -->
|
||||
<view class="-item-bottom">
|
||||
<view class="-item-bootom-money" @click="handleNavgationGoods(item)">
|
||||
<!-- <view class="-item-bl">
|
||||
比率:
|
||||
<span>{{ "5.00%" }}</span>
|
||||
</view> -->
|
||||
<view class="-item-yj">
|
||||
<span>¥{{ item.price | unitPrice }}</span>
|
||||
<view class="goods-item-desc">
|
||||
<!-- 商品描述 -->
|
||||
<view class="-item-title" @click="handleNavgationGoods(item)">
|
||||
{{ item.goodsName }}
|
||||
</view>
|
||||
<!-- 商品金额 -->
|
||||
<view class="-item-price" @click="handleNavgationGoods(item)">
|
||||
佣金:
|
||||
<span> ¥{{ item.commission | unitPrice }}</span>
|
||||
</view>
|
||||
<!-- 比率佣金 -->
|
||||
<view class="-item-bottom">
|
||||
<view class="-item-bootom-money" @click="handleNavgationGoods(item)">
|
||||
<!-- <view class="-item-bl">
|
||||
比率:
|
||||
<span>{{ "5.00%" }}</span>
|
||||
</view> -->
|
||||
<view class="-item-yj">
|
||||
<span>¥{{ item.price | unitPrice }}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="click" v-if="!params.checked" @click="handleClickGoods(item)">立即选取</view>
|
||||
<view class="click" v-if="params.checked" @click="handleLink(item)">分销商品</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="click" v-if="!params.checked" @click="handleClickGoods(item)">立即选取</view>
|
||||
<view class="click" v-if="params.checked" @click="handleLink(item)">分销商品</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</div>
|
||||
</u-swipe-action>
|
||||
</div>
|
||||
</u-swipe-action>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
<view class="empty">
|
||||
<!-- <u-empty v-if="empty" text="没有分销商品了" mode="list"></u-empty> -->
|
||||
@@ -295,15 +298,30 @@ export default {
|
||||
});
|
||||
this.goodsList.push(...res.data.result.records);
|
||||
}
|
||||
if (this.goodsList.length == 0) {
|
||||
if (this.goodsList.length === 0) {
|
||||
this.empty = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 底部加载数据
|
||||
*/
|
||||
renderDate() {
|
||||
|
||||
this.params.pageNumber += 1;
|
||||
this.init();
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.body-view {
|
||||
overflow-y: auto;
|
||||
height: calc(100vh - 44px - 80rpx - 104rpx);
|
||||
}
|
||||
.canvas-hide {
|
||||
/* 1 */
|
||||
position: fixed;
|
||||
|
||||
@@ -27,36 +27,7 @@
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- 显示收藏的店铺栏 -->
|
||||
<view v-else class="tab-content">
|
||||
<scroll-view class="list-scroll-content" scroll-y>
|
||||
<!-- 空白页 -->
|
||||
<u-empty style="margin-top: 40rpx" text="暂无收藏店铺数据" mode="favor" v-if="storeEmpty"></u-empty>
|
||||
<!-- 店铺展示数据 -->
|
||||
<u-swipe-action @open="openLeftChange(item, 'store')" :show="item.selected" btn-width="180"
|
||||
:options="LeftOptions" v-else v-for="(item, index) in storeList" :key="index"
|
||||
@click="clickStoreSwiperAction(item)">
|
||||
<view class="store" @click="goStoreMainPage(item.id)">
|
||||
<view class="intro">
|
||||
<view class="store-logo">
|
||||
<u-image width="102rpx" height="102rpx" :src="item.storeLogo" :alt="item.storeName"
|
||||
mode="aspectFit">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
</view>
|
||||
<view class="store-name">
|
||||
<view>{{ item.storeName }}</view>
|
||||
<u-tag size="mini" type="error" :color="$mainColor" v-if="item.selfOperated"
|
||||
text="自营" mode="plain" shape="circle" />
|
||||
</view>
|
||||
<view class="store-collect">
|
||||
<view>进店逛逛</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-swipe-action>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -90,14 +61,7 @@
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "店铺(0)",
|
||||
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
goodsEmpty: false, //商品数据是否为空
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
<template>
|
||||
<view class="myTracks">
|
||||
<u-navbar title="我的足迹">
|
||||
|
||||
<div slot="right">
|
||||
<div class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '编辑' : '完成'}}</div>
|
||||
</div>
|
||||
</u-navbar>
|
||||
<u-notice-bar mode="vertical" :list="['右划删除浏览记录']"></u-notice-bar>
|
||||
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
|
||||
<div v-else>
|
||||
<view v-if="item" v-for="(item, index) in trackList" :key="index">
|
||||
<view class="myTracks-title" @click="navigateToStore(item)" v-if="item.storeName">{{item.storeName}}</view>
|
||||
<view v-for="(item, index) in trackList" :key="index">
|
||||
<view class="myTracks-items">
|
||||
|
||||
<u-swipe-action style="width: 100%;" :show="item.show" :index="index" :key="item.id"
|
||||
@click="delTracks" @open="open" :options="options">
|
||||
<!-- 已失效商品 -->
|
||||
<div class="myTracks-item lose-goods" v-if="!item.storeName && !item.goodsName && !item.price">
|
||||
已失效商品
|
||||
</div>
|
||||
<!-- 正常有效商品 -->
|
||||
<view v-else class="myTracks-item">
|
||||
|
||||
<view class="myTracks-item">
|
||||
<u-checkbox-group v-if="isEdit" class="store-line-check">
|
||||
<u-checkbox shape="circle" :active-color="lightColor" v-model="item.checked"
|
||||
@change="checkboxChangeDP(item)"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<view class="myTracks-item-img" @click.stop="navigateToDetail(item)">
|
||||
<image :src="item.thumbnail"></image>
|
||||
</view>
|
||||
@@ -36,7 +38,9 @@
|
||||
<view class="myTracks-divider"></view>
|
||||
|
||||
</view>
|
||||
|
||||
<div @click="handleClickDeleteSelected" v-if="isEdit" class="submit">
|
||||
删除所选
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</view>
|
||||
@@ -51,7 +55,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
isEdit:false,
|
||||
whetherEmpty: false, //是否数据为空
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
@@ -59,6 +63,7 @@
|
||||
order: "desc",
|
||||
sort: "updateTime",
|
||||
},
|
||||
lightColor:this.$lightColor,
|
||||
options: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
@@ -86,6 +91,21 @@
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
checkboxChangeDP(val){
|
||||
console.log(val)
|
||||
},
|
||||
// 删除所选的数据
|
||||
handleClickDeleteSelected(val){
|
||||
const ids = this.trackList.filter(item=>item.checked).map(item=>item.goodsId);
|
||||
if(!ids.length){
|
||||
uni.showToast({
|
||||
title:"请选择删除数据",
|
||||
icon:"none"
|
||||
})
|
||||
}else{
|
||||
this.delTracks(0,ids)
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 导航到店铺
|
||||
*/
|
||||
@@ -120,11 +140,12 @@
|
||||
});
|
||||
myTrackList(this.params).then((res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||
uni.hideLoading();
|
||||
if (res.statusCode == 200) {
|
||||
res.data.result.records.length &&
|
||||
res.data.result.records.forEach((item) => {
|
||||
item.show = false;
|
||||
item.checked = false
|
||||
});
|
||||
|
||||
let data = res.data.result.records;
|
||||
@@ -141,10 +162,11 @@
|
||||
/**
|
||||
* 删除足迹
|
||||
*/
|
||||
delTracks(index) {
|
||||
deleteHistoryListId(this.trackList[index].goodsId).then((res) => {
|
||||
delTracks(index,ids) {
|
||||
deleteHistoryListId(ids || this.trackList[index].goodsId).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.trackList = [];
|
||||
this.params.pageNumber = 1
|
||||
this.getList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -160,9 +182,18 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.lose-goods{
|
||||
color: $main-color;
|
||||
padding-left: 50rpx !important;
|
||||
.submit{
|
||||
position: fixed;
|
||||
bottom: 20rpx;
|
||||
left: 10%;
|
||||
width: 80%;
|
||||
height: 80rpx;
|
||||
color: #fff;
|
||||
border-radius: 100px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: $light-color;
|
||||
}
|
||||
.myTracks {
|
||||
width: 100%;
|
||||
@@ -234,10 +265,39 @@
|
||||
padding: 10rpx 0 0 0;
|
||||
}
|
||||
|
||||
.myTracks-action {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
height: 75rpx;
|
||||
align-items: center;
|
||||
padding: 0 32rpx;
|
||||
}
|
||||
|
||||
.myTracks-action-btn {
|
||||
width: 130rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
|
||||
.myTracks-divider {
|
||||
width: 100%;
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.myTracks-action-check {
|
||||
align-items: center;
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
}
|
||||
.edit{
|
||||
padding-right: 32rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -84,7 +84,7 @@ export default {
|
||||
}
|
||||
if (!this.feedBack.context) {
|
||||
uni.showToast({
|
||||
title: "请填写反馈类型",
|
||||
title: "请填写反馈信息",
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
|
||||
@@ -16,21 +16,32 @@
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="生日" label-width="150" right-icon="arrow-right">
|
||||
<u-input v-model="birthday" disabled placeholder="请选择出生日期" @click="showBirthday = true" />
|
||||
<u-picker v-model="showBirthday" mode="time" :confirm-color="lightColor" @confirm="selectTime"></u-picker>
|
||||
<div style="width: 100%;" @click="showBirthday = true">{{ birthday || '请选择出生日期' }}</div>
|
||||
<u-picker v-model="showBirthday" mode="time" :confirm-color="lightColor" @confirm="selectTime"></u-picker>
|
||||
</u-form-item>
|
||||
<u-form-item label="城市" label-width="150" placeholder="请选择城市" right-icon="arrow-right">
|
||||
<u-input v-model="form.___path" disabled @click="clickRegion" />
|
||||
<div style="width: 100%;" @click="clickRegion">{{ form.___path || '请选择城市' }}</div>
|
||||
</u-form-item>
|
||||
<view class="submit" @click="submit">保存</view>
|
||||
<view class="submit" @click="quiteLoginOut">退出登录</view>
|
||||
|
||||
<u-form-item label="手机号" label-width="150">
|
||||
<view v-if="form.mobile">
|
||||
{{form.mobile}}
|
||||
</view>
|
||||
<view v-else>
|
||||
<view class="submit" @click="navigateTo(form.username)">绑定手机号码</view>
|
||||
</view>
|
||||
</u-form-item>
|
||||
|
||||
</u-form>
|
||||
|
||||
<div class="bottom">
|
||||
<view class="submit" @click="submit">保存</view>
|
||||
<view class="submit light" @click="quiteLoginOut">退出登录</view>
|
||||
</div>
|
||||
<m-city :provinceData="region" headTitle="区域选择" ref="cityPicker" @funcValue="getPickerParentValue" pickerSize="4"></m-city>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { saveUserInfo } from "@/api/members.js";
|
||||
import { saveUserInfo, getUserInfo } from "@/api/members.js";
|
||||
import { upload } from "@/api/common.js";
|
||||
import storage from "@/utils/storage.js";
|
||||
import uFormItem from "@/uview-ui/components/u-form-item/u-form-item.vue";
|
||||
@@ -48,6 +59,8 @@ export default {
|
||||
region: storage.getUserInfo().region || [], //地址
|
||||
sex: storage.getUserInfo().sex, //性别
|
||||
___path: storage.getUserInfo().region,
|
||||
mobile: storage.getUserInfo().mobile,
|
||||
username: storage.getUserInfo().username,
|
||||
},
|
||||
birthday: storage.getUserInfo().birthday || "", //生日
|
||||
photo: [
|
||||
@@ -158,6 +171,12 @@ export default {
|
||||
this.form.birthday = `${time.year}-${time.month}-${time.day}`;
|
||||
this.birthday = `${time.year} - ${time.month} - ${time.day}`;
|
||||
},
|
||||
|
||||
navigateTo(username) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/mine/set/securityCenter/bindMobile' + '?username=' + username,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -166,7 +185,11 @@ export default {
|
||||
onLoad() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page{
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.submit {
|
||||
height: 90rpx;
|
||||
@@ -207,4 +230,21 @@ export default {
|
||||
.form {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.bottom{
|
||||
position: fixed;
|
||||
bottom: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
>.submit{
|
||||
background: $light-color;
|
||||
color: #fff;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
}
|
||||
.light{
|
||||
background: rgba($color: $light-color, $alpha: 0.2) !important;
|
||||
color: $light-color !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
218
pages/mine/set/securityCenter/bindMobile.vue
Normal file
218
pages/mine/set/securityCenter/bindMobile.vue
Normal file
@@ -0,0 +1,218 @@
|
||||
<template>
|
||||
<view class="box">
|
||||
<view class="box-tips">
|
||||
<h2 class='h2'>
|
||||
绑定手机号码
|
||||
</h2>
|
||||
<view class="verification"></view>
|
||||
</view>
|
||||
<view class="form">
|
||||
<u-form :model="codeForm" ref="validateCodeForm">
|
||||
<view v-if="!validateFlage">
|
||||
<u-form-item label-width="120" label="手机号" prop="mobile">
|
||||
<u-input maxlength="11" v-model="codeForm.mobile" placeholder="请输入您的手机号" />
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item class="sendCode" label-width="120" prop="code" label="验证码">
|
||||
<u-input v-model="codeForm.code" placeholder="请输入验证码" />
|
||||
<u-verification-code unique-key="page-edit" :seconds="seconds" @end="end" @start="start"
|
||||
ref="uCode" @change="codeChange"></u-verification-code>
|
||||
<view @tap="getCode" class="text-tips">{{ tips }}</view>
|
||||
</u-form-item>
|
||||
|
||||
<view class="submit" @click="validatePhone">绑定</view>
|
||||
<myVerification keep-running @send="verification" class="verification" ref="verification"
|
||||
business="BIND_MOBILE" />
|
||||
</view>
|
||||
</u-form>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
sendMobile,
|
||||
bindMobile
|
||||
} from "@/api/login";
|
||||
|
||||
import myVerification from "@/components/verification/verification.vue"; //验证
|
||||
import uuid from "@/utils/uuid.modified.js";
|
||||
export default {
|
||||
components: {
|
||||
myVerification,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
uuid,
|
||||
validateFlage: false, //是否进行了手机号验证
|
||||
step: 0, //当前验证步骤
|
||||
flage: false, //是否验证码验证
|
||||
codeForm: {
|
||||
mobile: "", //手机号
|
||||
code: "", //验证码
|
||||
username: "", //用户名
|
||||
},
|
||||
tips: "", //提示
|
||||
seconds: 69, // 60s等待时间
|
||||
|
||||
// 验证码登录校验
|
||||
codeRules: {
|
||||
mobile: [{
|
||||
validator: (rule, value, callback) => {
|
||||
return this.$u.test.mobile(value);
|
||||
},
|
||||
message: "手机号码不正确",
|
||||
trigger: ["blur"],
|
||||
}, ],
|
||||
code: [{
|
||||
min: 4,
|
||||
max: 6,
|
||||
required: true,
|
||||
message: "请输入验证码",
|
||||
trigger: ["blur"],
|
||||
}, ],
|
||||
},
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.codeForm.username = options.username;
|
||||
},
|
||||
onReady() {
|
||||
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||
this.$refs.validateCodeForm.setRules(this.codeRules);
|
||||
},
|
||||
watch: {
|
||||
flage(val) {
|
||||
if (val) {
|
||||
if (this.$refs.uCode.canGetCode) {
|
||||
uni.showLoading({
|
||||
title: "正在获取验证码",
|
||||
});
|
||||
sendMobile(this.codeForm.mobile, "BIND_MOBILE").then((res) => {
|
||||
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||
// 这里此提示会被this.start()方法中的提示覆盖
|
||||
if (res.data.success) {
|
||||
this.$refs.uCode.start();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
this.flage = false;
|
||||
this.$refs.verification.getCode();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$u.toast("请倒计时结束后再发送");
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 验证码验证
|
||||
verification(val) {
|
||||
this.flage = val == this.$store.state.verificationKey ? true : false;
|
||||
},
|
||||
|
||||
// 验证手机号
|
||||
validatePhone() {
|
||||
this.$refs.validateCodeForm.validate((valid) => {
|
||||
if (valid) {
|
||||
bindMobile(this.codeForm).then((res) => {
|
||||
if (res.data.success) {
|
||||
this.validateFlage = !this.validateFlage;
|
||||
// 登录成功
|
||||
uni.showToast({
|
||||
title: "绑定成功!",
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
codeChange(text) {
|
||||
this.tips = text;
|
||||
},
|
||||
end() {
|
||||
|
||||
this.flage = false;
|
||||
this.$refs.verification.getCode()
|
||||
},
|
||||
|
||||
/**获取验证码 */
|
||||
getCode() {
|
||||
if (this.tips == "重新获取") {
|
||||
this.$refs.verification.error(); //发送
|
||||
}
|
||||
if (!this.$u.test.mobile(this.codeForm.mobile)) {
|
||||
uni.showToast({
|
||||
title: "请输入正确手机号",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.flage) {
|
||||
this.$refs.verification.error(); //发送
|
||||
return false;
|
||||
}
|
||||
},
|
||||
start() {
|
||||
this.$u.toast("验证码已发送");
|
||||
this.flage = true;
|
||||
|
||||
this.$refs.verification.hide();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import url("@/pages/passport/login.scss");
|
||||
|
||||
/deep/ .u-form-item {
|
||||
margin: 40rpx 0;
|
||||
}
|
||||
|
||||
.sendCode {
|
||||
/deep/ .u-form-item--right__content__slot {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.h2 {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.box {
|
||||
padding: 80rpx 0;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.submit {
|
||||
background: $light-color;
|
||||
}
|
||||
|
||||
.box-tips {
|
||||
margin: 0 72rpx;
|
||||
}
|
||||
|
||||
.verification {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -18,6 +18,7 @@
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<u-cell-item title="安全中心" @click="navigateTo('/pages/mine/set/securityCenter/securityCenter')"></u-cell-item>
|
||||
<!-- #endif -->
|
||||
<u-cell-item title="用户注销" v-if="userInfo.id" @click="logoff"></u-cell-item>
|
||||
<u-cell-item title="意见反馈" @click="navigateTo('/pages/mine/set/feedBack')"></u-cell-item>
|
||||
<!-- #ifndef H5 -->
|
||||
<!-- #endif -->
|
||||
@@ -56,7 +57,12 @@ export default {
|
||||
this.$options.filters.quiteLoginOut();
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 用户注销
|
||||
*/
|
||||
logoff(){
|
||||
this.$options.filters.logoff();
|
||||
},
|
||||
|
||||
/**
|
||||
* 读取当前缓存
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
</view>
|
||||
<div class="u-tabs-search">
|
||||
<u-search
|
||||
placeholder="请输入订单编号"
|
||||
placeholder="请输入订单编号/商品名称/售后单号"
|
||||
@search="submitSearchOrderList(current)"
|
||||
@clear="submitSearchOrderList(current)"
|
||||
@clear="clear(current)"
|
||||
@custom="submitSearchOrderList(current)"
|
||||
v-model="orderSn"
|
||||
v-model="keywords"
|
||||
>
|
||||
</u-search>
|
||||
</div>
|
||||
@@ -28,9 +28,6 @@
|
||||
>
|
||||
<!-- 店铺名称 -->
|
||||
<view class="seller-info u-flex u-row-between" v-if="current == 0">
|
||||
<view class="seller-name">
|
||||
<view class="name">{{ order.storeName }}</view>
|
||||
</view>
|
||||
<view class="order-sn">订单编号:{{ order.sn }}</view>
|
||||
</view>
|
||||
<!-- 申请记录 选项卡 -->
|
||||
@@ -239,13 +236,13 @@ export default {
|
||||
pageSize: 10,
|
||||
},
|
||||
status: "loadmore",
|
||||
orderSn: "", // 搜索订单sn
|
||||
keywords: "", // 搜索订单sn
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.orderList = [];
|
||||
this.params.pageNumber = 1;
|
||||
if (options.orderSn) this.params.orderSn = options.orderSn;
|
||||
if (options.orderSn) this.params.keywords = options.orderSn;
|
||||
this.searchOrderList(this.current);
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
@@ -261,6 +258,14 @@ export default {
|
||||
this.orderList = [];
|
||||
this.searchOrderList(current);
|
||||
},
|
||||
// 清空
|
||||
clear(current){
|
||||
this.params.pageNumber = 1;
|
||||
this.logParams.pageNumber = 1;
|
||||
this.params.keywords = ''
|
||||
this.orderList = [];
|
||||
this.searchOrderList(current);
|
||||
},
|
||||
/**
|
||||
* 切换tab页时,初始化数据
|
||||
*/
|
||||
@@ -282,7 +287,7 @@ export default {
|
||||
*/
|
||||
searchOrderList(index) {
|
||||
if (index == 0) {
|
||||
this.orderSn ? (this.params.orderSn = this.orderSn) : "";
|
||||
this.keywords ? (this.params.keywords = this.keywords) : "";
|
||||
this.getOrderList();
|
||||
} else {
|
||||
this.logParams = {
|
||||
@@ -294,7 +299,7 @@ export default {
|
||||
if (index === 1) {
|
||||
this.logParams.serviceStatus = "APPLY";
|
||||
}
|
||||
this.orderSn ? (this.logParams.orderSn = this.orderSn) : "";
|
||||
this.keywords ? (this.logParams.keywords = this.keywords) : "";
|
||||
this.orderList = [];
|
||||
this.getAfterSaleLogList();
|
||||
}
|
||||
|
||||
@@ -2,13 +2,6 @@
|
||||
<view class="content">
|
||||
<u-form :model="form" ref="uForm">
|
||||
<view class="after-sales-goods-detail-view">
|
||||
<view class="header">
|
||||
<view>
|
||||
本次售后服务将由
|
||||
<text class="seller-name">{{ sku.storeName }}</text>
|
||||
为您提供
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="goods-item-view" v-for="(item,index) in sku.orderItems" v-if="item.sn == sn"
|
||||
@click="gotoGoodsDetail(sku.goods_id)">
|
||||
@@ -37,9 +30,8 @@
|
||||
<view class="body-view">
|
||||
<!-- 退款原因 -->
|
||||
<view class="opt-view">
|
||||
<u-form-item label="申请原因" :label-width="150">
|
||||
<u-input v-model="form.reason" type="select" input-align="right" :select-open="reasonSelectShow"
|
||||
@click="reasonSelectShow = true" placeholder="请选择申请原因" />
|
||||
<u-form-item label="申请原因" :label-width="150" >
|
||||
<div style="width: 100%; text-align: right;" @click="reasonSelectShow = true">{{ form.reason || '请选择申请原因' }}</div>
|
||||
</u-form-item>
|
||||
<u-form-item label="申请说明" :label-width="150">
|
||||
<u-input input-align="right" type="textarea" v-model="form.problemDesc" placeholder="请描述申请售后的说明" />
|
||||
|
||||
@@ -2,13 +2,7 @@
|
||||
<view class="mp-iphonex-bottom content">
|
||||
<u-form :model="form" ref="uForm">
|
||||
<view class="after-sales-goods-detail-view">
|
||||
<view class="header">
|
||||
<view>
|
||||
本次售后服务将由
|
||||
<text class="seller-name">{{ sku.storeName }}</text>
|
||||
为您提供
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view class="goods-item-view" @click="gotoGoodsDetail(sku.skuId)">
|
||||
<view class="goods-img">
|
||||
@@ -30,16 +24,16 @@
|
||||
<view class="opt-view">
|
||||
<view class="img-title" style="font-size: 30rpx">填写物流信息</view>
|
||||
<u-form-item label="返回方式" :label-width="150">
|
||||
<u-input type="text" input-align="right" value="快递至第三方卖家" />
|
||||
<div style="width: 100%; text-align: right;">快递至第三方卖家</div>
|
||||
</u-form-item>
|
||||
<u-form-item label="快递公司" :label-width="150">
|
||||
<u-input v-model="form.courierCompany" type="select" input-align="right" :select-open="companySelectShow" @click="companySelectShow = true" placeholder="请选择快递公司" />
|
||||
<div style="width: 100%; text-align: right;" @click="companySelectShow = true" >{{ form.courierCompany || '请选择快递公司' }}</div>
|
||||
</u-form-item>
|
||||
<u-form-item label="快递单号" :label-width="150">
|
||||
<u-input input-align="right" v-model="form.logisticsNo" placeholder="请输入快递单号" />
|
||||
</u-form-item>
|
||||
<u-form-item label="发货时间" :label-width="150">
|
||||
<u-input input-align="right" type="selects" disabled v-model="form.mDeliverTime" @click="timeshow = true" placeholder="请选择发货时间" />
|
||||
<div style="width: 100%; text-align: right;" @click="timeshow = true" >{{ form.mDeliverTime || '请选择发货时间' }}</div>
|
||||
</u-form-item>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="after-sales-goods-detail-view">
|
||||
<view class="header">
|
||||
<view>
|
||||
本次售后服务将由
|
||||
<text class="seller-name">{{ sku.storeName }}</text>
|
||||
为您提供
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view class="goods-item-view" :key="index" v-for="(item,index) in sku.orderItems" v-if="item.sn == sn" @click="navigateToGoodsDetail(sku.skuId)">
|
||||
<view class="goods-img">
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
<template>
|
||||
<view v-if="serviceDetail">
|
||||
<view class="after-sales-goods-detail-view">
|
||||
<view class="header">
|
||||
<view>
|
||||
本次售后服务将由
|
||||
<text class="seller-name">{{ serviceDetail.storeName }}</text>
|
||||
为您提供
|
||||
</view>
|
||||
</view>
|
||||
<view class="apply-info-view">
|
||||
<view class="status-info">
|
||||
<view class="status-info-box">
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<view class="seller-view">
|
||||
<view class="seller-info u-flex u-row-between">
|
||||
<view class="seller-name">
|
||||
<view class="name">{{ order.storeName || "" }}</view>
|
||||
<view class="status">{{ orderStatusList[order.orderStatus] }}</view>
|
||||
</view>
|
||||
<view class="order-sn"></view>
|
||||
@@ -68,6 +67,7 @@ export default {
|
||||
orderStatusList: {
|
||||
//订单状态列表
|
||||
UNDELIVERED: "待发货",
|
||||
PARTS_DELIVERED: "部分发货",
|
||||
UNPAID: "未付款",
|
||||
PAID: "已付款",
|
||||
DELIVERED: "已发货",
|
||||
|
||||
@@ -35,6 +35,13 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="speak-way" v-else>暂无对话</view>
|
||||
<view class="tips">回复对话</view>
|
||||
<view class="cell-item complain-content">
|
||||
<view class="cell-view content">
|
||||
<u-input type="textarea" height="70rpx" auto-height v-model="complainValue" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="submit-btn" @click="handleSubmit">回复</view>
|
||||
<view class="tips">平台仲裁</view>
|
||||
<u-cell-group>
|
||||
<u-cell-item :arrow="false" title="仲裁意见" :value="complainDetail.arbitrationResult || '暂无'"></u-cell-item>
|
||||
@@ -43,13 +50,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getComplainDetail } from "@/api/after-sale";
|
||||
import { getComplainDetail, communication } from "@/api/after-sale";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
complainId: "",
|
||||
complainValue: "", //回复内容
|
||||
complainDetail: "", //投诉详情
|
||||
statusData: {
|
||||
NEW: "新投诉",
|
||||
NEW: "新投诉",
|
||||
NO_APPLY: "未申请",
|
||||
APPLYING: "申请中",
|
||||
COMPLETE: "已完成",
|
||||
@@ -61,6 +70,7 @@ export default {
|
||||
},
|
||||
|
||||
onLoad(option) {
|
||||
this.complainId = option.id;
|
||||
this.init(option.id);
|
||||
},
|
||||
methods: {
|
||||
@@ -78,6 +88,38 @@ export default {
|
||||
},
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
if (!this.complainValue) {
|
||||
uni.showToast({
|
||||
title: "请输入回复内容",
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
}
|
||||
let params = {
|
||||
content: this.complainValue,
|
||||
complainId: this.complainId,
|
||||
};
|
||||
communication(params).then((res) => {
|
||||
if (res.data.success) {
|
||||
uni.showToast({
|
||||
title: "回复成功",
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
this.complainValue = '';
|
||||
this.init(this.complainId);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
/**
|
||||
* 初始化投诉详情
|
||||
*/
|
||||
@@ -126,4 +168,32 @@ export default {
|
||||
.tips {
|
||||
margin: 40rpx 32rpx;
|
||||
}
|
||||
.cell {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
padding: 26rpx;
|
||||
}
|
||||
.complain-content {
|
||||
margin: 40rpx 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
}
|
||||
.title {
|
||||
width: 140rpx;
|
||||
}
|
||||
}
|
||||
.submit-btn {
|
||||
width: 70%;
|
||||
margin: 0 auto;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background: $light-color;
|
||||
margin-top: 20px;
|
||||
border-radius: 200px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
<view>
|
||||
<view class="seller-view" v-for="(item, index) in complaionData" :key="index">
|
||||
<view class="seller-info u-flex u-row-between">
|
||||
<view class="seller-name">
|
||||
<view class="name">{{ item.storeName }}</view>
|
||||
</view>
|
||||
<view class="order-sn">{{ statusData[item.complainStatus] }}</view>
|
||||
</view>
|
||||
<u-line color="#DCDFE6"></u-line>
|
||||
|
||||
248
pages/order/deliverDetail.vue
Normal file
248
pages/order/deliverDetail.vue
Normal file
@@ -0,0 +1,248 @@
|
||||
<template>
|
||||
<div>
|
||||
<view class="logistics-detail">
|
||||
<view class="card">
|
||||
<div v-if="logisticsList && logisticsList.length>0">
|
||||
<ul class="express-log" v-for="(packageItem, packageIndex) in logisticsList" :key="packageIndex" v-if="packageItem">
|
||||
<div class="layui-layer-wrap">
|
||||
<dl>
|
||||
<dt>物流公司:</dt>
|
||||
<dd><div class="text-box">{{ packageItem.logisticsName }}</div></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>快递单号:</dt>
|
||||
<dd>
|
||||
<div nctype="ordersSn" class="text-box">
|
||||
<a class="item" :href='"https://www.baidu.com/s?wd="+packageItem.logisticsNo' target="_blank">{{ packageItem.logisticsNo }}</a>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="div-express-log">
|
||||
<ul class="express-log express-log-name">
|
||||
<li v-for="(item, index) in packageItem.orderPackageItemList" :key="index">
|
||||
<p class="time" style="width: 50%;"><span>商品名称:</span><span>{{ item.goodsName }}</span></p>
|
||||
<p class="time" style="width: 30%;"><span>发货时间:</span><span>{{ item.logisticsTime }}</span></p>
|
||||
<p class="time" style="width: 20%;"><span>发货数量:</span><span>{{ item.deliverNumber }}</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="div-express-log">
|
||||
<ul class="express-log" v-if="packageItem.traces && packageItem.traces.traces">
|
||||
<li v-for="(item, index) in packageItem.traces.traces" :key="index">
|
||||
<span class="time">{{ item.AcceptTime || item.acceptTime }}</span>
|
||||
<span class="detail">{{ item.AcceptStation || item.remark }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="express-log" v-else>
|
||||
<li>暂无物流信息</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPackage } from "@/api/trade.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
order: {},
|
||||
logisticsList: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
onLoad(option) {
|
||||
let sn = option.order_sn;
|
||||
this.tracesList(sn);
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
tracesList(sn) {
|
||||
getPackage(sn).then((res) => {
|
||||
if(res.data.success){
|
||||
this.logisticsList = res.data.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style >
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
// @import url('./goods.scss');
|
||||
.goods-item-view {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
.goods-img {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.goods-info {
|
||||
padding-left: 30rpx;
|
||||
flex: 3;
|
||||
|
||||
.goods-title {
|
||||
margin-bottom: 10rpx;
|
||||
color: $font-color-dark;
|
||||
}
|
||||
|
||||
.goods-specs {
|
||||
font-size: 24rpx;
|
||||
margin-bottom: 10rpx;
|
||||
color: #cccccc;
|
||||
}
|
||||
|
||||
.goods-price {
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 10rpx;
|
||||
color: #ff5a10;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-num {
|
||||
>.good-complaint {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
text-align: center;
|
||||
flex: 1;
|
||||
width: 60rpx;
|
||||
color: $main-color;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.goods-info {
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
background: #f2f2f2;
|
||||
}
|
||||
.logistics-detail {
|
||||
margin-top: 20rpx;
|
||||
padding: 0 16rpx;
|
||||
}
|
||||
.card {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
width: 100%;
|
||||
> .card-title {
|
||||
font-size: 24rpx;
|
||||
border-top-left-radius: 20rpx;
|
||||
border-top-right-radius: 20rpx;
|
||||
padding: 16rpx;
|
||||
}
|
||||
> .time-line {
|
||||
padding: 16rpx 32rpx;
|
||||
}
|
||||
}
|
||||
.u-order-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
.u-order-desc {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
.u-order-time {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
.empty {
|
||||
padding: 40rpx 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.express-log {
|
||||
/*margin: 5px -10px 5px 5px;*/
|
||||
padding: 20rpx;
|
||||
list-style-type: none;
|
||||
li {
|
||||
display: flex;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
li:nth-of-type(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
.time {
|
||||
width: 140rpx;
|
||||
display: flex;
|
||||
// float: left;
|
||||
flex-direction: column;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
span:nth-of-type(1) {
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.detail {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
margin-left: 30rpx;
|
||||
display: inline-block;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
li {
|
||||
line-height: 60rpx;
|
||||
}
|
||||
}
|
||||
.layui-layer-wrap {
|
||||
dl {
|
||||
border-top: solid 1px #f5f5f5;
|
||||
margin-top: -2rpx;
|
||||
overflow: hidden;
|
||||
|
||||
dt {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
display: inline-block;
|
||||
padding: 16rpx 1% 16rpx 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
dd {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
display: inline-block;
|
||||
padding: 16rpx 0 16rpx 16rpx;
|
||||
border-left: solid 2rpx #f5f5f5;
|
||||
|
||||
.text-box {
|
||||
line-height: 40rpx;
|
||||
color: #333;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.div-express-log {
|
||||
// max-height: 600rpx;
|
||||
border: solid 2rpx #e7e7e7;
|
||||
background: #fafafa;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 6rpx;
|
||||
// overflow-y: auto;
|
||||
// overflow-x: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -11,11 +11,6 @@
|
||||
<u-empty text="尚无需要评价的商品" mode="list" v-if="orderList.length == 0"></u-empty>
|
||||
<view class="seller-view" v-for="(order, index) in orderList" :key="index">
|
||||
<!-- 店铺名称 -->
|
||||
<view class="box-title">
|
||||
<view class="title_seller_name">
|
||||
{{ order.storeName }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-for="(sku, _index) in order.orderItems" :key="_index">
|
||||
<view class="goods-item-view">
|
||||
<view>
|
||||
@@ -115,7 +110,8 @@ export default {
|
||||
onShow() {
|
||||
this.orderList = [];
|
||||
this.params.pageNumber = 1;
|
||||
this.current == 0 ? this.loadData() : this.loadComments();
|
||||
this.current = 0
|
||||
this.loadData()
|
||||
},
|
||||
watch: {
|
||||
/**
|
||||
|
||||
@@ -125,11 +125,6 @@
|
||||
:key="index"
|
||||
>
|
||||
<div v-if="item.checked">
|
||||
<div @click="navigateToStore(item)">
|
||||
<div class="store-name">
|
||||
<span>{{ item.storeName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="promotionNotice">{{ item.promotionNotice || "" }}</div>
|
||||
<div
|
||||
class="flex goods-item"
|
||||
@@ -386,13 +381,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import * as API_Trade from "@/api/trade";
|
||||
import * as API_Address from "@/api/address";
|
||||
import * as API_Order from "@/api/order";
|
||||
import * as API_Trade from "@/api/trade";
|
||||
import configs from "@/config/config";
|
||||
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
||||
import invoices from "@/pages/order/invoice/setInvoice";
|
||||
import { mapState } from "vuex";
|
||||
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
||||
import configs from "@/config/config";
|
||||
export default {
|
||||
onLoad: function (val) {
|
||||
this.routerVal = val;
|
||||
@@ -445,6 +440,8 @@ export default {
|
||||
notSupportFreight: [], //不支持运费
|
||||
notSupportFreightGoodsList: ["以下商品超出配送范围:"],
|
||||
storeAddress: "",
|
||||
|
||||
originOrderData:"", // 原始订单数据
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -482,6 +479,7 @@ export default {
|
||||
* 监听返回
|
||||
*/
|
||||
onBackPress(e) {
|
||||
console.log("onBackPress", e);
|
||||
if (e.from == "backbutton") {
|
||||
let routes = getCurrentPages();
|
||||
let curRoute = routes[routes.length - 1].options;
|
||||
@@ -495,7 +493,7 @@ export default {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
console.log("curRoute.addId",curRoute.addId)
|
||||
if (curRoute.addId) {
|
||||
uni.reLaunch({
|
||||
url: "/pages/tabbar/cart/cartList",
|
||||
@@ -651,7 +649,7 @@ export default {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
} else if (this.shippingText === "LOGISTICS" && this.orderMessage.cartTypeEnum != 'VIRTUAL') {
|
||||
} else if (this.shippingText === "LOGISTICS" && this.orderMessage.cartTypeEnum !== 'VIRTUAL') {
|
||||
if (!this.address.id) {
|
||||
uni.showToast({
|
||||
title: "请选择地址",
|
||||
@@ -785,18 +783,29 @@ export default {
|
||||
this.notSupportFreight = [];
|
||||
// 获取结算参数
|
||||
API_Trade.getCheckoutParams(this.routerVal.way).then((res) => {
|
||||
// 获取结算参数 进行首次判断
|
||||
this.originOrderData = this.orderMessage ? JSON.parse(JSON.stringify(this.orderMessage)) : ""
|
||||
|
||||
if (
|
||||
!res.data.result.checkedSkuList ||
|
||||
res.data.result.checkedSkuList.length === 0
|
||||
) {
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/cart/cartList",
|
||||
});
|
||||
|
||||
if(!this.originOrderData.checkedSkuList.length){
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/cart/cartList",
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
if (res.data.result.skuList.length <= 0) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/order/myOrder?status=0",
|
||||
});
|
||||
|
||||
if(!this.originOrderData.skuList.length){
|
||||
uni.navigateTo({
|
||||
url: "/pages/order/myOrder?status=0",
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let repeatData;
|
||||
|
||||
@@ -39,10 +39,7 @@
|
||||
v-for="(order, oderIndex) in tabItem.orderList"
|
||||
>
|
||||
<!-- 店铺名称 -->
|
||||
<view class="seller-info u-flex u-row-between">
|
||||
<view class="seller-name wes" @click="navigateToStore(order)">
|
||||
<view class="name wes">{{ order.storeName }}</view>
|
||||
</view>
|
||||
<view class="seller-info u-flex u-row-left ">
|
||||
<view class="order-sn">{{
|
||||
order.orderStatus | orderStatusList
|
||||
}}</view>
|
||||
@@ -138,7 +135,7 @@
|
||||
shape="circle"
|
||||
class="cancel-btn"
|
||||
size="mini"
|
||||
v-if="order.groupAfterSaleStatus && (order.groupAfterSaleStatus==='NOT_APPLIED'|| order.groupAfterSaleStatus==='PART_AFTER_SALE' )"
|
||||
v-if="order.groupAfterSaleStatus && ( order.groupAfterSaleStatus.includes('NOT_APPLIED') || order.groupAfterSaleStatus.includes('PART_AFTER_SALE'))"
|
||||
@click="applyService(order)"
|
||||
>
|
||||
退款/售后
|
||||
@@ -701,7 +698,7 @@ page,
|
||||
}
|
||||
|
||||
.order-sn {
|
||||
flex:2;
|
||||
|
||||
width:120rpx;
|
||||
text-align: center;
|
||||
color: $aider-light-color;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<!-- 物流信息 -->
|
||||
<view class="info-view logistics-view">
|
||||
<view class="logistics-List" v-if="logisticsList && logisticsList.traces.length != 0 ">
|
||||
<view class="logistics-List" v-if="logisticsList && logisticsList.traces && logisticsList.traces.length != 0 ">
|
||||
<view class="logistics-List-title">
|
||||
{{ logisticsList.traces[logisticsList.traces.length - 1].AcceptStation }}
|
||||
</view>
|
||||
@@ -23,6 +23,14 @@
|
||||
<view class="verificationCode" v-if="order.verificationCode">
|
||||
券码: {{ order.orderStatus == 'CANCELLED' ? '已失效' : order.verificationCode }}
|
||||
</view>
|
||||
<view @click="handleClickDeliver()" class="info-view logi-view" v-else-if="orderPackage && orderPackage.length">
|
||||
<view class="verificationCode">
|
||||
当前订单有 {{ orderPackage.length }} 个包裹快递
|
||||
</view>
|
||||
<div>
|
||||
点击此处查看
|
||||
</div>
|
||||
</view>
|
||||
<view v-else class="logistics-List-title">
|
||||
{{ '暂无物流信息' }}
|
||||
</view>
|
||||
@@ -30,7 +38,7 @@
|
||||
|
||||
</view>
|
||||
<!-- 地址 -->
|
||||
<view class="info-view" v-if="order.deliveryMethod == 'LOGISTICS'">
|
||||
<view class="info-view" v-if="order.deliveryMethod === 'LOGISTICS' && order.orderType !== 'VIRTUAL'">
|
||||
<view class="address-view">
|
||||
<view>
|
||||
<view class="address-title">
|
||||
@@ -44,7 +52,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 提货地址 -->
|
||||
<view class="info-view" v-if="order.deliveryMethod == 'SELF_PICK_UP'">
|
||||
<view class="info-view" v-if="order.deliveryMethod === 'SELF_PICK_UP'">
|
||||
<view class="address-view">
|
||||
<view>
|
||||
<view class="order-info-view">
|
||||
@@ -64,14 +72,6 @@
|
||||
<view>
|
||||
<view class="seller-view">
|
||||
<!-- 店铺名称 -->
|
||||
<view class="seller-info u-flex u-row-between">
|
||||
<view class="seller-name" @click="goToShopPage(order)">
|
||||
<view class="name">{{ order.storeName }}</view>
|
||||
<view class="status" v-if="orderStatusList[order.orderStatus]"> {{ orderStatusList[order.orderStatus].title
|
||||
}}</view>
|
||||
</view>
|
||||
<view class="order-sn"></view>
|
||||
</view>
|
||||
<view>
|
||||
<view v-for="(sku, skuIndex) in orderGoodsList" :key="skuIndex">
|
||||
<view class="goods-item-view">
|
||||
@@ -83,6 +83,9 @@
|
||||
<view class="goods-price">
|
||||
¥{{ sku.goodsPrice | unitPrice }}
|
||||
<!-- <span v-if="sku.point">+{{ sku.point }}积分</span> -->
|
||||
<span style="font-size: 24rpx;margin-left: 14rpx;color: #ff9900;" v-if="sku.isRefund && sku.isRefund !== 'NO_REFUND'">
|
||||
{{refundPriceList(sku.isRefund)}} ({{ sku.refundPrice | unitPrice("¥") }})
|
||||
</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-num">
|
||||
@@ -105,11 +108,11 @@
|
||||
<view class="title">商品总价:</view>
|
||||
<view class="value">¥{{ order.goodsPrice | unitPrice }}</view>
|
||||
</view>
|
||||
<view class="order-info-view">
|
||||
<view class="order-info-view" v-if="order.freightPrice">
|
||||
<view class="title">运费:</view>
|
||||
<view class="value">¥{{ order.freightPrice | unitPrice }}</view>
|
||||
</view>
|
||||
<view class="order-info-view">
|
||||
<view class="order-info-view" v-if="order.priceDetailDTO">
|
||||
<view class="title">优惠券:</view>
|
||||
<view class="value main-color">-¥{{ order.priceDetailDTO.couponPrice | unitPrice }}</view>
|
||||
</view>
|
||||
@@ -159,7 +162,7 @@
|
||||
<view class="order-info-view">
|
||||
<view class="title">订单备注:</view>
|
||||
<view class="value">{{
|
||||
order.remark
|
||||
order.remark || '暂无备注'
|
||||
}}</view>
|
||||
</view>
|
||||
<view class="order-info-view">
|
||||
@@ -249,7 +252,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getExpress } from "@/api/trade.js";
|
||||
import { getExpress, getPackage } from "@/api/trade.js";
|
||||
import { cancelOrder, confirmReceipt, getOrderDetail } from "@/api/order.js";
|
||||
|
||||
import shares from "@/components/m-share/index"; //分享
|
||||
@@ -278,6 +281,10 @@ export default {
|
||||
title: "待发货",
|
||||
value: "商品等待发货中",
|
||||
},
|
||||
PARTS_DELIVERED: {
|
||||
title: "部分发货",
|
||||
value: "商品已部分发货。",
|
||||
},
|
||||
DELIVERED: {
|
||||
title: "已发货",
|
||||
value: "商品已发货,请您耐心等待",
|
||||
@@ -307,6 +314,7 @@ export default {
|
||||
cancelList: "",
|
||||
rogShow: false,
|
||||
reason: "",
|
||||
orderPackage:"",
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
@@ -314,6 +322,34 @@ export default {
|
||||
this.sn = options.sn;
|
||||
},
|
||||
methods: {
|
||||
//获取包裹
|
||||
async getOrderPackage() {
|
||||
getPackage(this.order.sn).then(res => {
|
||||
if (res.data.success) {
|
||||
this.orderPackage = res.data.result
|
||||
}
|
||||
})
|
||||
},
|
||||
handleClickDeliver(){
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/deliverDetail?order_sn=${this.order.sn}`,
|
||||
});
|
||||
},
|
||||
// 退款状态枚举
|
||||
refundPriceList(status) {
|
||||
switch (status) {
|
||||
case 'ALL_REFUND':
|
||||
return "全部退款";
|
||||
case 'PART_REFUND':
|
||||
return "部分退款";
|
||||
case 'NO_REFUND':
|
||||
return "未退款";
|
||||
case 'REFUNDING':
|
||||
return "退款中";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
},
|
||||
callPhone(){
|
||||
this.$options.filters.callPhone(this.order.storeAddressMobile )
|
||||
},
|
||||
@@ -359,7 +395,8 @@ export default {
|
||||
this.orderGoodsList = order.orderItems;
|
||||
this.orderDetail = res.data.result;
|
||||
if (this.order.deliveryMethod === 'LOGISTICS') {
|
||||
this.loadLogistics(sn)
|
||||
this.loadLogistics(sn);
|
||||
this.getOrderPackage();
|
||||
}
|
||||
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||
});
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
:border-bottom="false"
|
||||
prop="companyAddressPath"
|
||||
label="公司所在地"
|
||||
><u-input
|
||||
type="select"
|
||||
>
|
||||
<div @click="showPicker()" style="margin-right: 30rpx;">选择</div>
|
||||
<u-input
|
||||
disabled
|
||||
:custom-style="defaultInputStyle"
|
||||
v-model="form.companyAddressPath"
|
||||
disabled
|
||||
@click="showPicker()"
|
||||
/></u-form-item>
|
||||
<u-form-item
|
||||
required
|
||||
@@ -338,6 +338,7 @@ export default {
|
||||
},
|
||||
// 显示三级地址联动
|
||||
showPicker() {
|
||||
console.log(this.$refs)
|
||||
this.$refs.cityPicker.show();
|
||||
},
|
||||
validatorStep1Form() {
|
||||
|
||||
@@ -33,7 +33,10 @@
|
||||
:border-bottom="false"
|
||||
prop="goodsManagementCategory"
|
||||
label="店铺经营类目"
|
||||
><u-input
|
||||
>
|
||||
<div @click="showCategory()" style="margin-right: 30rpx;">选择</div>
|
||||
|
||||
<u-input
|
||||
:custom-style="defaultInputStyle"
|
||||
v-model="goodsManagementCategory"
|
||||
disabled
|
||||
@@ -46,15 +49,17 @@
|
||||
prop="storeAddressPath"
|
||||
label="店铺所在地"
|
||||
>
|
||||
<div @click="showPicker()" style="margin-right: 30rpx;">选择</div>
|
||||
<u-input
|
||||
:custom-style="defaultInputStyle"
|
||||
v-model="form.storeAddressPath"
|
||||
|
||||
disabled
|
||||
@click="showPicker()"
|
||||
|
||||
/>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item
|
||||
|
||||
<!-- <u-form-item
|
||||
required
|
||||
:border-bottom="false"
|
||||
prop="storeAddressPath"
|
||||
@@ -62,7 +67,7 @@
|
||||
>
|
||||
<div class="get-center" @click="clickUniMap()">开始定位</div>
|
||||
<div class="tips-success" v-if="form.storeCenter">已成功定位</div>
|
||||
</u-form-item>
|
||||
</u-form-item> -->
|
||||
|
||||
<u-form-item
|
||||
required
|
||||
@@ -287,7 +292,7 @@ export default {
|
||||
},
|
||||
getPickerParentValue(e) {
|
||||
this.form.storeAddressIdPath = [];
|
||||
|
||||
console.log(e)
|
||||
let name = "";
|
||||
e.forEach((item, index) => {
|
||||
if (item.id) {
|
||||
@@ -298,9 +303,11 @@ export default {
|
||||
} else {
|
||||
name += item.localName + ",";
|
||||
}
|
||||
this.form.storeAddressPath = name;
|
||||
this.$set(this.form,'storeAddressPath',name)
|
||||
}
|
||||
});
|
||||
|
||||
this.form.storeCenter = e[e.length-1].center
|
||||
},
|
||||
// 显示三级地址联动
|
||||
showPicker() {
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
onShow() {
|
||||
|
||||
// 只要是app登录的全部清除内容
|
||||
// #ifdef APP-PLUS
|
||||
// #ifdef APP-PLUS
|
||||
storage.setAccessToken("");
|
||||
storage.setRefreshToken("");
|
||||
storage.setUserInfo({});
|
||||
@@ -204,7 +204,7 @@
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
||||
|
||||
// #ifndef APP-PLUS
|
||||
//判断是否微信浏览器
|
||||
var ua = window.navigator.userAgent.toLowerCase();
|
||||
@@ -428,7 +428,7 @@
|
||||
//写入用户信息
|
||||
uni.setStorageSync("nickname", infoRes.userInfo.nickName);
|
||||
uni.setStorageSync("avatar", infoRes.userInfo.avatarUrl);
|
||||
uni.setStorageSync("unionId", infoRes.userInfo.unionId);
|
||||
uni.setStorageSync("unionId", infoRes.userInfo.unionId || infoRes.userInfo.unionid);
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
//微信小程序获取openid 需要特殊处理 如需获取openid请参考uni-id: https://uniapp.dcloud.net.cn/uniCloud/uni-id
|
||||
@@ -460,7 +460,7 @@
|
||||
token:{unionId:"",openId:uni.getStorageSync("openid")}
|
||||
};
|
||||
uni.getStorageSync("unionId") ? (params.token.unionId = uni.getStorageSync("unionId")) : delete params.token;
|
||||
|
||||
|
||||
openIdLogin(params, clientType).then((res) => {
|
||||
if (!res.data.success) {
|
||||
let errormessage = "第三方登录暂不可用";
|
||||
@@ -599,9 +599,9 @@
|
||||
uni.navigateTo({
|
||||
url: "/pages/mine/help/tips?type=" + val,
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
// 点击获取验证码
|
||||
start() {
|
||||
this.codeColor = "#999";
|
||||
|
||||
@@ -20,10 +20,18 @@
|
||||
<view>您的公开信息(昵称、头像)</view>
|
||||
</view>
|
||||
<view class="btns">
|
||||
<button type="primary" bindtap="getUserProfile" @click="getUserProfile()"
|
||||
<button type="primary" :disabled="logingFlag" bindtap="getUserProfile" @click="getUserProfile()"
|
||||
class="btn-auth">登录</button>
|
||||
<div @click="backToHome" class="btn-callback">暂不登录</div>
|
||||
</view>
|
||||
<div class="privacy">
|
||||
<u-checkbox shape="circle" v-model="checked" :active-color="lightColor">
|
||||
<div class="flex">
|
||||
阅读并同意<navigator class="light-color" url="/pages/mine/help/tips?type=PRIVACY_POLICY">《隐私协议》</navigator>
|
||||
<navigator class="light-color" url="/pages/mine/help/tips?type=USER_AGREEMENT">《用户协议》</navigator>
|
||||
</div>
|
||||
</u-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
@@ -45,6 +53,8 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
lightColor:this.$lightColor,
|
||||
checked:false,
|
||||
configs:config,
|
||||
// 是否展示手机号码授权弹窗,默认第一步不展示,要先获取用户基础信息
|
||||
phoneAuthPopup: false,
|
||||
@@ -54,6 +64,7 @@
|
||||
code: "",
|
||||
//微信昵称
|
||||
nickName: "",
|
||||
logingFlag: false,
|
||||
//微信头像
|
||||
image: "",
|
||||
};
|
||||
@@ -66,7 +77,19 @@
|
||||
withShareTicket: true
|
||||
});
|
||||
|
||||
let that = this;
|
||||
|
||||
//获取code
|
||||
uni.login({
|
||||
success: (res) => {
|
||||
if(res.errMsg === "login:ok") {
|
||||
this.code = res.code
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "系统异常,请联系管理员!"
|
||||
})
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
},
|
||||
methods: {
|
||||
@@ -93,27 +116,23 @@
|
||||
|
||||
//获取用户信息
|
||||
getUserProfile(e) {
|
||||
let that = this;
|
||||
//获取code
|
||||
uni.login({
|
||||
success: (res) => {
|
||||
if(res.errMsg === "login:ok") {
|
||||
that.code = res.code
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "系统异常,请联系管理员!"
|
||||
})
|
||||
}
|
||||
},
|
||||
});
|
||||
if(!this.checked){
|
||||
uni.showToast({
|
||||
title:"请勾选协议",
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.logingFlag = true;
|
||||
|
||||
if (this.code) {
|
||||
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
|
||||
uni.getUserProfile({
|
||||
desc: "用于完善会员资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
|
||||
success: (res) => {
|
||||
that.nickName = res.userInfo.nickName;
|
||||
that.image = res.userInfo.avatarUrl;
|
||||
console.log("success", res)
|
||||
this.nickName = res.userInfo.nickName;
|
||||
this.image = res.userInfo.avatarUrl;
|
||||
|
||||
/**
|
||||
* 根据公有的配置设置登录方式
|
||||
@@ -152,13 +171,15 @@
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
fail: (res) => {
|
||||
|
||||
console.log("fail", res)
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
this.logingFlag = false;
|
||||
}
|
||||
},
|
||||
|
||||
//获取手机号授权
|
||||
@@ -353,4 +374,10 @@
|
||||
transform: scale(1.1);
|
||||
}
|
||||
}
|
||||
|
||||
.privacy{
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -155,15 +155,17 @@ export default {
|
||||
* 顶部筛选条件
|
||||
*/
|
||||
select(index) {
|
||||
this.params = {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
this.selectIndex = index;
|
||||
this.params.grade = ["", "GOOD", "MODERATE", "WORSE", ""][
|
||||
this.selectIndex
|
||||
];
|
||||
this.selectIndex == 4 ? (this.params.haveImage = 1) : true;
|
||||
this.params.pageNumber = 1;
|
||||
this.params.pageSize = 10;
|
||||
this.selectIndex === 4 ? (this.params.haveImage = 1) : true;
|
||||
this.commDetail = [];
|
||||
if (this.selectIndex == 0) {
|
||||
if (this.selectIndex === 0) {
|
||||
this.params = {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
|
||||
@@ -183,9 +183,7 @@
|
||||
<!-- 评价 -->
|
||||
<Evaluation id="main5" :goodsDetail="goodsDetail" />
|
||||
|
||||
<!-- 店铺推荐 -->
|
||||
<storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />
|
||||
|
||||
|
||||
<!-- 宝贝详情 -->
|
||||
<GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId"
|
||||
v-if="goodsDetail.id" />
|
||||
@@ -198,10 +196,6 @@
|
||||
|
||||
<view class="page-bottom mp-iphonex-bottom" id="pageBottom">
|
||||
<view class="icon-btn">
|
||||
<view class="icon-btn-item" @click="navigateToStore(goodsDetail.storeId)">
|
||||
<u-icon size="34" class="red" name="home-fill"></u-icon>
|
||||
<view class="red icon-btn-name">店铺</view>
|
||||
</view>
|
||||
<view class="icon-btn-item" @click="linkMsgDetail()">
|
||||
<u-icon size="34" name="kefu-ermai"></u-icon>
|
||||
<view class="icon-btn-name">客服</view>
|
||||
@@ -293,7 +287,7 @@ import PromotionAssembleListLayout from "./product/promotion/-promotion-assemble
|
||||
import PromotionCoupon from "./product/promotion/-promotion-coupon"; //优惠券组件
|
||||
import GoodsIntro from "./product/goods/-goods-intro"; //商品介绍组件
|
||||
import GoodsRecommend from "./product/goods/-goods-recommend"; //宝贝推荐
|
||||
import storeLayout from "./product/shop/-shop"; //店铺组件
|
||||
|
||||
import Evaluation from "./product/evaluation/-evaluation"; //评价组件
|
||||
import GoodsSwiper from "./product/goods/-goods-swiper"; //轮播图组件
|
||||
import popupGoods from "@/components/m-buy/goods"; //购物车商品的模块
|
||||
@@ -314,7 +308,7 @@ export default {
|
||||
PromotionCoupon,
|
||||
GoodsIntro,
|
||||
GoodsRecommend,
|
||||
storeLayout,
|
||||
|
||||
Evaluation,
|
||||
GoodsSwiper,
|
||||
popupGoods,
|
||||
@@ -554,7 +548,7 @@ export default {
|
||||
this.productId = id; // skuId
|
||||
// 这里请求获取到页面数据 解析数据
|
||||
|
||||
let response = await getGoods(id, goodsId);
|
||||
let response = await getGoods(id || 'undefined', goodsId);
|
||||
|
||||
// 判断当前接口返回内容
|
||||
if (!response.data.success) {
|
||||
@@ -594,7 +588,7 @@ export default {
|
||||
}
|
||||
});
|
||||
// 轮播图
|
||||
this.imgList = this.goodsDetail.goodsGalleryList;
|
||||
this.imgList = this.goodsDetail.goodsGalleryList.filter(i => i.indexOf("\"url\":") === -1 && i.indexOf("\"status\":") === -1);
|
||||
|
||||
// 获取店铺基本信息
|
||||
this.getStoreBaseInfoFun(this.goodsDetail.storeId);
|
||||
@@ -625,7 +619,7 @@ export default {
|
||||
|
||||
linkMsgDetail () {
|
||||
// lili 基础客服
|
||||
this.$options.filters.talkIm(this.goodsDetail.storeId, this.routerVal.goodsId, this.routerVal.id)
|
||||
this.$options.filters.talkIm(this.goodsDetail.storeId, this.routerVal.goodsId, this.routerVal.id,this.goodsDetail)
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/mine/im/index?userId=${this.goodsDetail.storeId}&goodsid=${this.routerVal.goodsId}&skuid=${this.routerVal.id}`
|
||||
// });
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
<u-image width="120rpx" mode="aspectFit" height="120rpx" :src="storeDetail.storeLogo"></u-image>
|
||||
</view>
|
||||
<view class="name-star star-con">
|
||||
<div class="name">
|
||||
{{ storeDetail.storeName }}
|
||||
<span v-if="storeDetail.selfOperated == 1" class="shopTag">自营</span>
|
||||
</div>
|
||||
<div class="store-row">
|
||||
<div class="collectionNum">{{ storeDetail.collectionNum || 0 }}人关注</div>
|
||||
<div class="goodsNum">{{ storeDetail.goodsNum || 0 }}件商品</div>
|
||||
@@ -67,7 +63,7 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
@import "../product.scss";
|
||||
.recommend-item-name {
|
||||
height: 70rpx;
|
||||
height: 60rpx;
|
||||
color: #333;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="store-msg">
|
||||
<div class="store-name">
|
||||
{{item.storeName}}
|
||||
</div>
|
||||
<div class="goods-num">
|
||||
商品 {{item.goodsNum}}
|
||||
</div>
|
||||
@@ -154,4 +151,4 @@ export default {
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<u-tabs :list="tabs" :active-color="mainColor" :is-scroll="false" :current="current" @change="changeTab"></u-tabs>
|
||||
<div class="content" v-if="current == 0">
|
||||
<u-empty style='margin-top:100rpx' v-if="goodsList.length == 0" class="empty" text='暂无商品信息'></u-empty>
|
||||
<goodsTemplate v-else :res="goodsList" :storeName="false" />
|
||||
<goodsTemplate style="width:100%;" v-else :res="goodsList" :storeName="false" />
|
||||
</div>
|
||||
<!-- 全部分类 -->
|
||||
<div class="category" v-if="current == 1">
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<u-navbar :is-back="false" title="购物车">
|
||||
<div slot="right">
|
||||
<div class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '编辑' : '完成'}}</div>
|
||||
</div>
|
||||
</u-navbar>
|
||||
<!-- 空白页-->
|
||||
<view v-if="!loading && (cartDetail.cartList == '' || cartDetail.cartList == [] || !cartDetail)" class="empty">
|
||||
<image src="/static/emptyCart.png" mode="aspectFit"></image>
|
||||
@@ -8,31 +13,14 @@
|
||||
<navigator class="navigator" url="/pages/tabbar/home/index" open-type="switchTab">随便逛逛></navigator>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 店铺商品信息 -->
|
||||
<div class="content">
|
||||
<div class="box box2" :class="{ invalid: isInvalid(item) }" v-for="(item, index) in cartDetail.cartList"
|
||||
:key="index">
|
||||
<view class="tab">
|
||||
<view class="store-line">
|
||||
<u-checkbox-group class="store-line-check">
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<u-checkbox shape="circle" :active-color="lightColor" v-model="item.checked"
|
||||
@change="checkboxChangeDP(item)"></u-checkbox>
|
||||
<!-- #endif -->
|
||||
<!-- 微信小程序这里 v-model出现问题,改用:value -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<u-checkbox shape="circle" :active-color="lightColor" :value="item.checked"
|
||||
@change="checkboxChangeDP(item)"></u-checkbox>
|
||||
<!-- #endif -->
|
||||
</u-checkbox-group>
|
||||
<span class="store-name wes store-line-desc" @click.stop="navigateToStore(item)">{{
|
||||
item.storeName
|
||||
}}</span>
|
||||
<u-icon @click="navigateToStore(item)" size="24" style="margin-left:10rpx;" name="arrow-right"></u-icon>
|
||||
</view>
|
||||
<view class="right-col" v-if="item.canReceiveCoupon" @click="navigateToCoupon(item)">
|
||||
<div class="right-line"></div>
|
||||
<span>领劵</span>
|
||||
</view>
|
||||
</view>
|
||||
@@ -73,7 +61,7 @@
|
||||
{{ skuItem.goodsSku.goodsName }}
|
||||
</p>
|
||||
<!-- 规格 -->
|
||||
<p class="sp-type">{{skuItem.goodsSku.simpleSpecs}}</p>
|
||||
<p class="sp-type" style="width:300rpx">{{skuItem.goodsSku.simpleSpecs}}</p>
|
||||
<p class="sp-type" v-if="skuItem.goodsSku.salesModel == 'WHOLESALE'">批发商品</p>
|
||||
<p class="sp-number">
|
||||
<view class="sp-price">
|
||||
@@ -554,6 +542,10 @@ page {
|
||||
.u-image {
|
||||
box-shadow: 0 4rpx 12rpx 0 rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.edit{
|
||||
padding-right: 32rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.promotion-notice {
|
||||
margin-top: 10px;
|
||||
margin-left: 68rpx;
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
<view class="category-wrap">
|
||||
<u-navbar class="navbar" :is-back="false">
|
||||
<div class="title">商品分类</div>
|
||||
<!-- #ifdef H5 -->
|
||||
<u-search class="nav-search" @click.native="search" placeholder="搜索商品" :show-action="false"></u-search>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef H5 -->
|
||||
<u-search class="nav-search" disabled @click.native="search" placeholder="搜索商品" :show-action="false"></u-search>
|
||||
<!-- #endif -->
|
||||
</u-navbar>
|
||||
<view class="content">
|
||||
<scroll-view scroll-y scroll-with-animation class="left-aside">
|
||||
|
||||
@@ -91,12 +91,6 @@
|
||||
<view>关于</view>
|
||||
</view>
|
||||
|
||||
<view class="interact-item" @click="navigateTo('/pages/passport/entry/seller/index')">
|
||||
<image src="/static/mine/feedback.png" mode=""></image>
|
||||
<view>店铺入驻</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="interact-item" @click="navigateTo('/pages/mine/set/setUp')">
|
||||
<image src="/static/mine/setting.png" mode=""></image>
|
||||
<view>设置</view>
|
||||
@@ -123,10 +117,25 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleNavigate(url) {
|
||||
uni.navigateTo({
|
||||
url,
|
||||
});
|
||||
},
|
||||
navigateTo(url) {
|
||||
uni.navigateTo({
|
||||
url,
|
||||
});
|
||||
const ignores = [
|
||||
'/pages/mine/set/setUp',
|
||||
'/pages/mine/set/editionIntro',
|
||||
'/pages/mine/set/feedBack'
|
||||
]
|
||||
if (!ignores.includes(url)) {
|
||||
if (this.$options.filters.tipsToLogin('normal')) {
|
||||
this.handleNavigate(url)
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.handleNavigate(url)
|
||||
}
|
||||
},
|
||||
|
||||
linkMsgDetail(){
|
||||
|
||||
3
uni.scss
3
uni.scss
@@ -153,6 +153,9 @@ $font-weight: 400;
|
||||
.flex-j-sb{
|
||||
justify-content: space-between;
|
||||
}
|
||||
.flex-j-c{
|
||||
justify-content: center;
|
||||
}
|
||||
.relative {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
183
utils/filters.js
183
utils/filters.js
@@ -1,8 +1,8 @@
|
||||
import Foundation from "./Foundation.js";
|
||||
import storage from "@/utils/storage.js";
|
||||
import { logout } from "@/api/login";
|
||||
import { logout, logoffConfirm } from "@/api/login";
|
||||
import { getUserInfo } from "@/api/members";
|
||||
import storage from "@/utils/storage.js";
|
||||
import Vue from "vue";
|
||||
import Foundation from "./Foundation.js";
|
||||
/**
|
||||
* 金钱单位置换 2999 --> 2,999.00
|
||||
* @param val
|
||||
@@ -10,7 +10,7 @@ import Vue from "vue";
|
||||
* @param location
|
||||
* @returns {*}
|
||||
*/
|
||||
export function unitPrice (val, unit, location) {
|
||||
export function unitPrice(val, unit, location) {
|
||||
if (!val) val = 0;
|
||||
let price = Foundation.formatPrice(val);
|
||||
if (location === "before") {
|
||||
@@ -27,7 +27,7 @@ export function unitPrice (val, unit, location) {
|
||||
* @param {*} val
|
||||
* @returns
|
||||
*/
|
||||
export function goodsFormatPrice (val) {
|
||||
export function goodsFormatPrice(val) {
|
||||
if (typeof val == "undefined") {
|
||||
return val;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export function goodsFormatPrice (val) {
|
||||
* 将内容复制到粘贴板
|
||||
*/
|
||||
import { h5Copy } from "@/js_sdk/h5-copy/h5-copy.js";
|
||||
export function setClipboard (val) {
|
||||
export function setClipboard(val) {
|
||||
// #ifdef H5
|
||||
if (val === null || val === undefined) {
|
||||
val = "";
|
||||
@@ -76,7 +76,7 @@ export function setClipboard (val) {
|
||||
* 拨打电话
|
||||
*/
|
||||
|
||||
export function callPhone (phoneNumber) {
|
||||
export function callPhone(phoneNumber) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: phoneNumber,
|
||||
});
|
||||
@@ -86,7 +86,7 @@ export function callPhone (phoneNumber) {
|
||||
* 脱敏姓名
|
||||
*/
|
||||
|
||||
export function noPassByName (str) {
|
||||
export function noPassByName(str) {
|
||||
if (null != str && str != undefined) {
|
||||
if (str.length <= 3) {
|
||||
return "*" + str.substring(1, str.length);
|
||||
@@ -106,7 +106,7 @@ export function noPassByName (str) {
|
||||
* @param format
|
||||
* @returns {*|string}
|
||||
*/
|
||||
export function unixToDate (unix, format) {
|
||||
export function unixToDate(unix, format) {
|
||||
let _format = format || "yyyy-MM-dd hh:mm:ss";
|
||||
const d = new Date(unix * 1000);
|
||||
const o = {
|
||||
@@ -137,7 +137,7 @@ export function unixToDate (unix, format) {
|
||||
*
|
||||
* @param {Object} datetime
|
||||
*/
|
||||
export function beautifyTime (datetime = "") {
|
||||
export function beautifyTime(datetime = "") {
|
||||
if (datetime == null || datetime == undefined || !datetime) {
|
||||
return "";
|
||||
}
|
||||
@@ -187,7 +187,7 @@ export function beautifyTime (datetime = "") {
|
||||
return `${minutes}分钟前`;
|
||||
}
|
||||
// 时间转换
|
||||
function timestampToTime (timestamp) {
|
||||
function timestampToTime(timestamp) {
|
||||
var date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
|
||||
var Y = date.getFullYear() + '-';
|
||||
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
|
||||
@@ -203,7 +203,7 @@ function timestampToTime (timestamp) {
|
||||
* @param mobile
|
||||
* @returns {*}
|
||||
*/
|
||||
export function secrecyMobile (mobile) {
|
||||
export function secrecyMobile(mobile) {
|
||||
mobile = String(mobile);
|
||||
if (!/\d{11}/.test(mobile)) {
|
||||
return mobile;
|
||||
@@ -216,7 +216,7 @@ export function secrecyMobile (mobile) {
|
||||
*
|
||||
* @param {Object} datetime
|
||||
*/
|
||||
export function formatTime (datetime) {
|
||||
export function formatTime(datetime) {
|
||||
if (datetime == null) return "";
|
||||
|
||||
datetime = datetime.replace(/-/g, "/");
|
||||
@@ -271,7 +271,7 @@ export function formatTime (datetime) {
|
||||
* @param {String} cFormat
|
||||
* @returns {String | null}
|
||||
*/
|
||||
export function parseTime (time, cFormat) {
|
||||
export function parseTime(time, cFormat) {
|
||||
if (arguments.length === 0) {
|
||||
return null;
|
||||
}
|
||||
@@ -320,7 +320,7 @@ export function parseTime (time, cFormat) {
|
||||
* 清除逗号
|
||||
*
|
||||
*/
|
||||
export function clearStrComma (str) {
|
||||
export function clearStrComma(str) {
|
||||
str = str.replace(/,/g, ""); //取消字符串中出现的所有逗号
|
||||
return str;
|
||||
}
|
||||
@@ -330,7 +330,7 @@ export function clearStrComma (str) {
|
||||
* @param val 如果为auth则判断是否登录
|
||||
* 如果传入 auth 则为判断是否登录
|
||||
*/
|
||||
export function isLogin (val) {
|
||||
export function isLogin(val) {
|
||||
let userInfo = storage.getUserInfo();
|
||||
if (val == "auth") {
|
||||
return userInfo && userInfo.id ? true : false;
|
||||
@@ -343,16 +343,17 @@ export function isLogin (val) {
|
||||
* 退出登录
|
||||
*
|
||||
*/
|
||||
export function quiteLoginOut () {
|
||||
export function quiteLoginOut() {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "是否退出登录?",
|
||||
confirmColor: Vue.prototype.$mainColor,
|
||||
async success (res) {
|
||||
async success(res) {
|
||||
if (res.confirm) {
|
||||
storage.setAccessToken("");
|
||||
storage.setRefreshToken("");
|
||||
storage.setUserInfo({});
|
||||
storage.setHasLogin(false)
|
||||
navigateToLogin("redirectTo");
|
||||
await logout();
|
||||
}
|
||||
@@ -360,23 +361,114 @@ export function quiteLoginOut () {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户注销
|
||||
*
|
||||
*/
|
||||
export function logoff() {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "确认注销用户么?注销用户将无法再次登录并失去当前数据就。根据法规数据最长保留6个月,期间可以联系客服人员进行恢复数据。",
|
||||
confirmColor: Vue.prototype.$mainColor,
|
||||
async success(res) {
|
||||
if (res.confirm) {
|
||||
await logoffConfirm();
|
||||
storage.setAccessToken("");
|
||||
storage.setRefreshToken("");
|
||||
storage.setUserInfo({});
|
||||
navigateToLogin("redirectTo");
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
import { getImSetting } from '@/api/im.js'
|
||||
/**
|
||||
* 跳转im
|
||||
*/
|
||||
export function talkIm (storeId, goodsId, id) {
|
||||
export async function talkIm(storeId, goodsId, id,goodsDetail) {
|
||||
if (isLogin('auth')) {
|
||||
let url = `/pages/mine/im/index?userId=${storeId}`
|
||||
if(goodsId && id) url = `/pages/mine/im/index?userId=${storeId}&goodsid=${goodsId}&skuid=${id}`
|
||||
uni.navigateTo({
|
||||
url
|
||||
});
|
||||
try {
|
||||
const res = await getImSetting()
|
||||
if (res.data.success) {
|
||||
let setting = res.data.result
|
||||
|
||||
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
||||
let curRoute = routes[routes.length - 1].route //获取当前页面路由
|
||||
let curParam = routes[routes.length - 1].options; //获取路由参数
|
||||
// 拼接参数
|
||||
let param = ''
|
||||
for (let key in curParam) {
|
||||
param += '&' + key + '=' + curParam[key]
|
||||
}
|
||||
|
||||
// #ifdef H5
|
||||
window.location.href = setting.url;
|
||||
// #endif
|
||||
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
let sweixin = null
|
||||
plus.share.getServices(res => {
|
||||
sweixin = res.find(i => i.id === 'weixin')
|
||||
if (sweixin) {
|
||||
sweixin.openCustomerServiceChat({
|
||||
corpid: setting.companyId,
|
||||
url: setting.url,
|
||||
}, suc => {
|
||||
console.log("success", JSON.stringify(res))
|
||||
}, err => {
|
||||
console.log("error", JSON.stringify(err))
|
||||
})
|
||||
} else {
|
||||
plus.nativeUI.alert('当前环境不支持微信操作!')
|
||||
}
|
||||
}, function () {
|
||||
uni.showToast({
|
||||
title: "获取服务失败,不支持该操作。" + JSON.stringify(e),
|
||||
icon: 'error'
|
||||
})
|
||||
})
|
||||
// plus.runtime.openURL('https://work.weixin.qq.com/kfid/kfcda2f3a9985de16f7', function(res) {});
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
if (wx.openCustomerServiceChat) {
|
||||
console.log(curRoute + param)
|
||||
wx.openCustomerServiceChat({
|
||||
extInfo: { url: setting.url },
|
||||
corpId: setting.companyId,
|
||||
sendMessageImg: goodsDetail.goodsGalleryList[0],
|
||||
sendMessagePath: curRoute + param,
|
||||
sendMessageTitle: goodsDetail.goodsName,
|
||||
showMessageCard: true,
|
||||
success(res) {
|
||||
console.log("res", res)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
|
||||
})
|
||||
}
|
||||
|
||||
// #endif
|
||||
}
|
||||
} catch (error) {
|
||||
// uni.showToast({
|
||||
// title: '网络错误请稍后重试',
|
||||
// icon: 'none'
|
||||
// })
|
||||
}
|
||||
}
|
||||
else {
|
||||
tipsToLogin()
|
||||
}
|
||||
}
|
||||
|
||||
export function tipsToLogin () {
|
||||
export function tipsToLogin(type) {
|
||||
if (!isLogin("auth")) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
@@ -386,9 +478,15 @@ export function tipsToLogin () {
|
||||
confirmColor: Vue.prototype.$mainColor,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
navigateToLogin();
|
||||
// navigateToLogin();
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/login",
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
uni.navigateBack();
|
||||
if (type !== 'normal') {
|
||||
uni.navigateBack();
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -400,7 +498,7 @@ export function tipsToLogin () {
|
||||
/**
|
||||
* 获取用户信息并重新添加到缓存里面
|
||||
*/
|
||||
export async function userInfo () {
|
||||
export async function userInfo() {
|
||||
let res = await getUserInfo();
|
||||
if (res.data.success) {
|
||||
storage.setUserInfo(res.data.result);
|
||||
@@ -414,7 +512,7 @@ export async function userInfo () {
|
||||
* @returns
|
||||
*/
|
||||
|
||||
export function forceLogin () {
|
||||
export function forceLogin() {
|
||||
let userInfo = storage.getUserInfo();
|
||||
if (!userInfo || !userInfo.id) {
|
||||
// #ifdef MP-WEIXIN
|
||||
@@ -439,7 +537,7 @@ export function forceLogin () {
|
||||
* 获取当前加载的页面对象
|
||||
* @param val
|
||||
*/
|
||||
export function getPages (val) {
|
||||
export function getPages(val) {
|
||||
const pages = getCurrentPages(); //获取加载的页面
|
||||
const currentPage = pages[pages.length - 1]; //获取当前页面的对象
|
||||
const url = currentPage.route; //当前页面url
|
||||
@@ -450,7 +548,7 @@ export function getPages (val) {
|
||||
/**
|
||||
* 跳转到登录页面
|
||||
*/
|
||||
export function navigateToLogin (type = "navigateTo") {
|
||||
export function navigateToLogin(type = "navigateTo") {
|
||||
/**
|
||||
* 此处进行条件编译判断
|
||||
* 微信小程序跳转到微信小程序登录页面
|
||||
@@ -471,7 +569,7 @@ export function navigateToLogin (type = "navigateTo") {
|
||||
/**
|
||||
* 服务状态列表
|
||||
*/
|
||||
export function serviceStatusList (val) {
|
||||
export function serviceStatusList(val) {
|
||||
let statusList = {
|
||||
APPLY: "申请售后",
|
||||
PASS: "通过售后",
|
||||
@@ -491,11 +589,12 @@ export function serviceStatusList (val) {
|
||||
/**
|
||||
* 订单状态列表
|
||||
*/
|
||||
export function orderStatusList (val) {
|
||||
export function orderStatusList(val) {
|
||||
let orderStatusList = {
|
||||
UNDELIVERED: "待发货",
|
||||
UNPAID: "未付款",
|
||||
PAID: "已付款",
|
||||
PARTS_DELIVERED: "部分发货",
|
||||
DELIVERED: "已发货",
|
||||
CANCELLED: "已取消",
|
||||
COMPLETED: "已完成",
|
||||
@@ -505,3 +604,21 @@ export function orderStatusList (val) {
|
||||
};
|
||||
return orderStatusList[val];
|
||||
}
|
||||
|
||||
// 比较版本
|
||||
export function compareVersions(str1, str2) {
|
||||
const arr1 = str1.split('.').map(Number);
|
||||
const arr2 = str2.split('.').map(Number);
|
||||
|
||||
const length = Math.max(arr1.length, arr2.length);
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
if (arr1[i] > arr2[i]) {
|
||||
return 1;
|
||||
} else if (arr1[i] < arr2[i]) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
180
utils/request.js
180
utils/request.js
@@ -1,16 +1,16 @@
|
||||
import Request from "@/lib/request/index.js";
|
||||
import {
|
||||
refreshTokenFn
|
||||
} from "@/api/login.js";
|
||||
import storage from "@/utils/storage.js";
|
||||
import api from "@/config/api.js";
|
||||
import Request from "@/lib/request/index.js";
|
||||
import Foundation from "@/utils/Foundation.js";
|
||||
import {
|
||||
md5
|
||||
} from "@/utils/md5.js";
|
||||
import Foundation from "@/utils/Foundation.js";
|
||||
import api from "@/config/api.js";
|
||||
import storage from "@/utils/storage.js";
|
||||
|
||||
import jwt from '@/js_sdk/t-jwt/jwt.js';
|
||||
import uuid from "@/utils/uuid.modified.js";
|
||||
import jwt from '@/js_sdk/t-jwt/jwt.js'
|
||||
import store from "../store";
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ http.interceptors.request.use(
|
||||
*/
|
||||
const decodeJwt = jwt(accessToken);
|
||||
const timing = new Date().getTime() / 1000
|
||||
if(decodeJwt.exp <= timing){
|
||||
if (decodeJwt.exp <= timing) {
|
||||
accessToken = ""
|
||||
storage.setAccessToken('')
|
||||
}
|
||||
@@ -132,95 +132,95 @@ let requests = [];
|
||||
// 必须使用异步函数,注意
|
||||
http.interceptors.response.use(
|
||||
async (response) => {
|
||||
isNavigateTo = false
|
||||
/* 请求之后拦截器。可以使用async await 做异步操作 */
|
||||
// token存在并且token过期
|
||||
// if (isRefreshing && response.statusCode === 403) {
|
||||
// cleanStorage();
|
||||
// isRefreshing = false;
|
||||
// }
|
||||
uni.showLoading() ? uni.hideLoading() : ''
|
||||
let token = storage.getAccessToken();
|
||||
if (
|
||||
(token && response.statusCode === 403) ||
|
||||
response.data.status === 403
|
||||
) {
|
||||
if (!isRefreshing) {
|
||||
console.log('旧token', token)
|
||||
isRefreshing = true;
|
||||
storage.setAccessToken('')
|
||||
let oldRefreshToken = storage.getRefreshToken();
|
||||
//调用刷新token的接口
|
||||
return refreshTokenFn(oldRefreshToken)
|
||||
.then((res) => {
|
||||
let {
|
||||
accessToken,
|
||||
refreshToken
|
||||
} = res.data.result;
|
||||
storage.setAccessToken(accessToken);
|
||||
storage.setRefreshToken(refreshToken);
|
||||
isNavigateTo = false
|
||||
/* 请求之后拦截器。可以使用async await 做异步操作 */
|
||||
// token存在并且token过期
|
||||
// if (isRefreshing && response.statusCode === 403) {
|
||||
// cleanStorage();
|
||||
// isRefreshing = false;
|
||||
// }
|
||||
uni.showLoading() ? uni.hideLoading() : ''
|
||||
let token = storage.getAccessToken();
|
||||
if (
|
||||
(token && response.statusCode === 403) ||
|
||||
response.data.status === 403
|
||||
) {
|
||||
if (!isRefreshing) {
|
||||
console.log('旧token', token)
|
||||
isRefreshing = true;
|
||||
storage.setAccessToken('')
|
||||
let oldRefreshToken = storage.getRefreshToken();
|
||||
//调用刷新token的接口
|
||||
return refreshTokenFn(oldRefreshToken)
|
||||
.then((res) => {
|
||||
let {
|
||||
accessToken,
|
||||
refreshToken
|
||||
} = res.data.result;
|
||||
storage.setAccessToken(accessToken);
|
||||
storage.setRefreshToken(refreshToken);
|
||||
|
||||
response.header.accessToken = `${accessToken}`;
|
||||
// token 刷新后将数组的方法重新执行
|
||||
console.log('接口队列', requests, '新token', accessToken)
|
||||
requests.forEach((cb) => cb(accessToken));
|
||||
requests = []; // 重新请求完清空
|
||||
return http.request(response.config);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('刷新token报错' + oldRefreshToken, err)
|
||||
cleanStorage();
|
||||
return Promise.reject(err);
|
||||
})
|
||||
.finally(() => {
|
||||
isRefreshing = false;
|
||||
});
|
||||
} else {
|
||||
// 返回未执行 resolve 的 Promise
|
||||
return new Promise((resolve) => {
|
||||
// 用函数形式将 resolve 存入,等待刷新后再执行
|
||||
requests.push((token) => {
|
||||
response.header.accessToken = `${token}`;
|
||||
resolve(http.request(response.config));
|
||||
});
|
||||
response.header.accessToken = `${accessToken}`;
|
||||
// token 刷新后将数组的方法重新执行
|
||||
console.log('接口队列', requests, '新token', accessToken)
|
||||
requests.forEach((cb) => cb(accessToken));
|
||||
requests = []; // 重新请求完清空
|
||||
return http.request(response.config);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('刷新token报错' + oldRefreshToken, err)
|
||||
cleanStorage();
|
||||
return Promise.reject(err);
|
||||
})
|
||||
.finally(() => {
|
||||
isRefreshing = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 如果当前返回没登录
|
||||
} else if (
|
||||
(!token && !storage.getRefreshToken() && response.statusCode === 403) ||
|
||||
response.data.code === 403
|
||||
) {
|
||||
console.log('没有token 以及刷新token 内容', token, storage.getRefreshToken())
|
||||
cleanStorage();
|
||||
|
||||
// 如果当前状态码为正常但是success为不正常时
|
||||
} else if (
|
||||
(response.statusCode == 200 && !response.data.success) ||
|
||||
response.statusCode == 400
|
||||
) {
|
||||
if (response.data.message) {
|
||||
uni.showToast({
|
||||
title: response.data.message,
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
success: function () {
|
||||
store.state.isShowToast = true;
|
||||
},
|
||||
fail: function () {
|
||||
store.state.isShowToast = false;
|
||||
},
|
||||
complete: function () {
|
||||
store.state.isShowToast = false;
|
||||
}
|
||||
} else {
|
||||
// 返回未执行 resolve 的 Promise
|
||||
return new Promise((resolve) => {
|
||||
// 用函数形式将 resolve 存入,等待刷新后再执行
|
||||
requests.push((token) => {
|
||||
response.header.accessToken = `${token}`;
|
||||
resolve(http.request(response.config));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 如果当前返回没登录
|
||||
} else if (
|
||||
(!token && !storage.getRefreshToken() && response.statusCode === 403) ||
|
||||
response.data.code === 403
|
||||
) {
|
||||
console.log('没有token 以及刷新token 内容', token, storage.getRefreshToken())
|
||||
cleanStorage();
|
||||
|
||||
// 如果当前状态码为正常但是success为不正常时
|
||||
} else if (
|
||||
(response.statusCode == 200 && !response.data.success) ||
|
||||
response.statusCode == 400
|
||||
) {
|
||||
if (response.data.message) {
|
||||
uni.showToast({
|
||||
title: response.data.message,
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
success: function () {
|
||||
store.state.isShowToast = true;
|
||||
},
|
||||
fail: function () {
|
||||
store.state.isShowToast = false;
|
||||
},
|
||||
complete: function () {
|
||||
store.state.isShowToast = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
return response;
|
||||
},
|
||||
(error) => {
|
||||
return error;
|
||||
}
|
||||
return response;
|
||||
},
|
||||
(error) => {
|
||||
return error;
|
||||
}
|
||||
);
|
||||
|
||||
export {
|
||||
|
||||
Reference in New Issue
Block a user