2023-02-28
功能完善
This commit is contained in:
@@ -11,26 +11,27 @@
|
||||
} from 'vuex';
|
||||
export default {
|
||||
methods: {
|
||||
...mapMutations(['login']) ,
|
||||
// util.js
|
||||
// 微信公众号授权
|
||||
wxAuthorize() {
|
||||
let link = window.location.href;
|
||||
let params = this._getUrlParams(link); // 地址解析
|
||||
...mapMutations(['login']),
|
||||
// util.js
|
||||
// 微信公众号授权
|
||||
wxAuthorize() {
|
||||
let link = window.location.href;
|
||||
let params = this._getUrlParams(link); // 地址解析
|
||||
|
||||
// 已经授权登录过的就不用再授权了
|
||||
if (store.state.token) return;
|
||||
// 已经授权登录过的就不用再授权了
|
||||
if (store.state.token) return;
|
||||
|
||||
// 如果拿到code,调用授权接口,没有拿到就跳转微信授权链接获取
|
||||
if (params.code) {
|
||||
api.wxAuth(params.code); // 调用后台接口,授权
|
||||
} else {
|
||||
let appid = 'wx8321531c6046c924';
|
||||
let uri = encodeURIComponent(link);
|
||||
let authURL = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${uri}&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect`;
|
||||
window.location.href = authURL;
|
||||
}
|
||||
},
|
||||
// 如果拿到code,调用授权接口,没有拿到就跳转微信授权链接获取
|
||||
if (params.code) {
|
||||
api.wxAuth(params.code); // 调用后台接口,授权
|
||||
} else {
|
||||
let appid = 'wx8321531c6046c924';
|
||||
let uri = encodeURIComponent(link);
|
||||
let authURL =
|
||||
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${uri}&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect`;
|
||||
window.location.href = authURL;
|
||||
}
|
||||
},
|
||||
async typeGoodsList() {
|
||||
let params = {};
|
||||
let list = await Api.apiCall('get', Api.goods.typeGoodsList, params);
|
||||
@@ -44,28 +45,34 @@
|
||||
async sysInfoMethod() {
|
||||
let params = {};
|
||||
let list = await Api.apiCall('get', Api.index.sysInfo, params);
|
||||
console.log('sysInfo>>>>>',sysInfo)
|
||||
console.log('sysInfo>>>>>', sysInfo)
|
||||
this.$db.set('sysInfo', list)
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
onLaunch: function() {
|
||||
// uni.removeStorageSync('userInfo');
|
||||
// uni.removeStorageSync('token');
|
||||
console.log('App onLaunch')
|
||||
let userInfo = uni.getStorageSync('userInfo') || '';
|
||||
let token = uni.getStorageSync('token') || '';
|
||||
if(token){
|
||||
let token = uni.getStorageSync('token') || '';
|
||||
console.log('App onLaunch>>>',userInfo)
|
||||
console.log('App onLaunch>>>',token)
|
||||
if (token) {
|
||||
//更新登陆状态
|
||||
uni.getStorage({
|
||||
key: 'userInfo',
|
||||
success: (res) => {
|
||||
console.log('App onLaunch>>', res)
|
||||
this.login(res.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let isWeiXin = this.$common.isWeiXinBrowser()
|
||||
if (isWeiXin) {
|
||||
this.wxAuthorize()
|
||||
}
|
||||
let isWeiXin = this.$common.isWeiXinBrowser()
|
||||
if (isWeiXin) {
|
||||
this.wxAuthorize()
|
||||
}
|
||||
this.typeGoodsList();
|
||||
this.areaGoodsList();
|
||||
this.sysInfoMethod();
|
||||
@@ -419,9 +426,13 @@
|
||||
video {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html,body,#app{
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
#app {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 骨架屏替代方案 */
|
||||
.Skeleton {
|
||||
background: #f3f3f3;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"name" : "汇融云链",
|
||||
"appid" : "__UNI__FB2C9C4",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0.2",
|
||||
"versionCode" : 1002,
|
||||
"versionName" : "1.0.0.3",
|
||||
"versionCode" : 1003,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
|
||||
@@ -89,12 +89,12 @@
|
||||
}, {
|
||||
"path": "pages/order/orderDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "详情展示",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"type": "transparent"
|
||||
}
|
||||
}
|
||||
"navigationBarTitleText": "详情展示"
|
||||
// "app-plus": {
|
||||
// "titleNView": {
|
||||
// "type": "transparent"
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}, {
|
||||
"path": "pages/order/logistics",
|
||||
|
||||
@@ -1079,11 +1079,13 @@
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 18px;
|
||||
color: $uni-color-primary;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
|
||||
.m-price {
|
||||
font-size: $font-sm;
|
||||
font-size: 16px;
|
||||
color: $font-color-light;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
@@ -1180,15 +1182,16 @@
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 18px;
|
||||
color: $uni-color-primary;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
|
||||
.m-price {
|
||||
font-size: $font-sm;
|
||||
font-size: 16px;
|
||||
color: $font-color-light;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
|
||||
.pro-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -1250,17 +1253,16 @@
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 16px;
|
||||
font-size: 18px;
|
||||
color: $uni-color-primary;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
|
||||
.m-price {
|
||||
font-size: $font-sm;
|
||||
font-size: 16px;
|
||||
color: $font-color-light;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
|
||||
.coupon_box {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
|
||||
@@ -70,13 +70,13 @@
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- 订单 -->
|
||||
<view class="order-section">
|
||||
<!-- <view class="order-section">
|
||||
<view class="order-item" @click="navTo('/pages/order/order?status=0')" hover-class="common-hover"
|
||||
:hover-stay-time="50">
|
||||
<text class="yticon icon-shouye"></text>
|
||||
<text>全部订单</text>
|
||||
</view>
|
||||
<view class="order-item" @click="navTo('/pages/order/order?status=2')" hover-class="common-hover"
|
||||
<view class="order-item" @click="navTo('/pages/order/order?status=1')" hover-class="common-hover"
|
||||
:hover-stay-time="50">
|
||||
<text class="yticon icon-daifukuan"></text>
|
||||
<text>待付款</text>
|
||||
@@ -92,7 +92,7 @@
|
||||
<text class="yticon icon-shouhoutuikuan"></text>
|
||||
<text>退款/售后</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 浏览历史 -->
|
||||
<view class="history-section icon">
|
||||
<view class="sec-header" v-if="viewList && viewList.length > 0">
|
||||
@@ -103,7 +103,8 @@
|
||||
<image v-for="(item, index) in viewList" :key="index" @click="navToDetailPage(item)" :src="item.pic"
|
||||
mode="aspectFill"></image>
|
||||
</scroll-view>
|
||||
<!--<list-cell icon="icon-iconfontweixin" iconColor="#e07472" title="我的钱包" tips="您的会员还有3天过期"></list-cell>-->
|
||||
<list-cell icon="icon-iconfontweixin" iconColor="#e07472" title="我的订单"
|
||||
@eventClick="navTo('../../pages/order/order?status=0')"></list-cell>
|
||||
<list-cell icon="icon-dizhi" iconColor="#5fcda2" title="地址管理"
|
||||
@eventClick="navTo('../../pagesU/address/address')"></list-cell>
|
||||
<list-cell icon="icon-tuandui" iconColor="#EE82EE" title="个人资料"
|
||||
@@ -270,10 +271,10 @@
|
||||
async getuserinfo() {
|
||||
let params = {};
|
||||
let data1 = await Api.apiCall('get', Api.index.userInfo, params);
|
||||
console.log("data》》》", data1);
|
||||
if (!data1) {
|
||||
this.userDetailInfo = {};
|
||||
}
|
||||
console.log("data", data1);
|
||||
|
||||
if (!data1.member) {
|
||||
this.logout();
|
||||
@@ -296,15 +297,15 @@
|
||||
this.viewList = data.result;
|
||||
}
|
||||
},
|
||||
upData(){
|
||||
upData() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '已经是最新版本',
|
||||
showCancel:false,
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -316,7 +317,7 @@
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
toUserInfo() {
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -431,7 +431,7 @@
|
||||
// let url = `/pages/money/pay?id=${id}`;
|
||||
let url = '/pages/order/payment/index?order_id=' + data.order.id + '&type=1';
|
||||
|
||||
uni.navigateTo({
|
||||
uni.redirectTo({
|
||||
url: url
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -363,7 +363,7 @@
|
||||
// let url = `/pages/money/pay?id=${id}`;
|
||||
let url = '/pages/order/payment/index?order_id=' + data.order.id + '&type=1';
|
||||
|
||||
uni.navigateTo({
|
||||
uni.redirectTo({
|
||||
url: url
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
<view v-for="(item, index) in tabItem.orderList" :key="index" class="order-item">
|
||||
<view class="i-top b-b">
|
||||
<text class="time" @click="navToDetailPage(item)">{{ item.createTime }}</text>
|
||||
<text class="state" :style="{ color: item.stateTipColor }" @click="navToDetailPage(item)">{{ item.id }}--</text>
|
||||
<!-- <text class="state" :style="{ color: item.stateTipColor }" @click="navToDetailPage(item)">{{ item.id }}</text> -->
|
||||
<text class="state" :style="{ color: item.stateTipColor }" @click="navToDetailPage(item)">{{ item.stateTip }}</text>
|
||||
<!-- <text v-if="item.status === 12" class="del-btn yticon icon-iconfontshanchu1" @click="deleteOrder(index)"></text> -->
|
||||
<text v-if="item.status === 12" class="del-btn yticon icon-iconfontshanchu1" @click="deleteOrder(index)"></text>
|
||||
</view>
|
||||
|
||||
<scroll-view v-if="item.orderItemList.length > 1" class="goods-box" scroll-y>
|
||||
@@ -30,8 +30,8 @@
|
||||
<text class="title clamp">{{ goodsItem.productName }}</text>
|
||||
<text class="attr-box">{{ goodsItem.productAttr }} x {{ goodsItem.productQuantity }}</text>
|
||||
<text class="price">{{ goodsItem.productPrice }}</text><br/>
|
||||
<text class="title clamp" v-if="item.status === 5">{{ item.deliveryCompany }}:{{ item.deliverySn }}</text>
|
||||
<text class="title clamp" v-if="item.status === 3">{{ item.deliveryCompany }}:{{ item.deliverySn }}</text>
|
||||
<!-- <text class="title clamp" v-if="item.status === 5">{{ item.deliveryCompany }}:{{ item.deliverySn }}</text>
|
||||
<text class="title clamp" v-if="item.status === 3">{{ item.deliveryCompany }}:{{ item.deliverySn }}</text> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -49,10 +49,10 @@
|
||||
<text class="state" :style="{ color: item.stateTipColor }" v-else-if="item.orderType == 5">积分订单</text>
|
||||
<button v-if="item.status == 12" class="action-btn" @click="cancelOrder(item)">取消订单</button>
|
||||
<button v-if="item.status == 12" class="action-btn recom" @click="payOrder(item)">立即支付</button>
|
||||
<button v-if="item.status > 2 && item.status < 10" class="action-btn recom" @click="lookLogistics(item.id)">物流追踪</button>
|
||||
<!-- <button v-if="item.status > 2 && item.status < 10" class="action-btn recom" @click="lookLogistics(item.id)">物流追踪</button> -->
|
||||
<button v-if="item.status < 5" class="action-btn recom" @click="applyRefund(item.id)">申请售后</button>
|
||||
<button v-if="item.status == 3" class="action-btn recom" @click="confimDelivery(item)">确认收货</button>
|
||||
<button class="action-btn recom" hover-class="btn-hover" v-if="item.status === 4" @click="toEvaluate(item.id)">立即评价</button>
|
||||
<!-- <button class="action-btn recom" hover-class="btn-hover" v-if="item.status === 4" @click="toEvaluate(item.id)">立即评价</button> -->
|
||||
</view>
|
||||
</view>
|
||||
<uni-load-more :status="loadingType"></uni-load-more>
|
||||
@@ -168,7 +168,7 @@ export default {
|
||||
|
||||
let params = { pageNum: this.pageNum, status: status };
|
||||
let data = await Api.apiCall('get', Api.order.orderList, params);
|
||||
console.log("data:------"+JSON.stringify(data))
|
||||
console.log("data:------"+data)
|
||||
let goodsList = data.records;
|
||||
let goodsListJson = JSON.stringify(goodsList)
|
||||
console.log("goodsList:"+goodsListJson)
|
||||
@@ -201,7 +201,7 @@ export default {
|
||||
}
|
||||
|
||||
navItem.orderList = [];
|
||||
console.log(JSON.stringify(orderList))
|
||||
console.log(orderList)
|
||||
orderList.forEach(item => {
|
||||
console.log("item-----:"+item)
|
||||
navItem.orderList.push(item);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -144,8 +144,16 @@
|
||||
methods: {
|
||||
...mapMutations(['login']),
|
||||
selectType(index) {
|
||||
this.selectKey = index
|
||||
this.show = !this.show
|
||||
|
||||
if (index == 0) {
|
||||
this.show = true
|
||||
this.selectKey = 0
|
||||
}
|
||||
|
||||
if (index == 1) {
|
||||
this.show = false
|
||||
this.selectKey = 1
|
||||
}
|
||||
|
||||
},
|
||||
inputChange(e) {
|
||||
@@ -258,7 +266,7 @@
|
||||
uni.showToast({
|
||||
title: '登录成功'
|
||||
});
|
||||
that.login(res.data.data);
|
||||
that.login(res.data.data.userInfo);
|
||||
that.$db.set('token', res.data.data.tokenHead + res.data.data.token);
|
||||
that.$db.set('userInfos', res.data.data.userInfo);
|
||||
|
||||
@@ -354,7 +362,7 @@
|
||||
uni.showToast({
|
||||
title: '登录成功'
|
||||
});
|
||||
that.login(res.data.data);
|
||||
that.login(res.data.data.userInfo);
|
||||
that.$db.set('token', res.data.data.tokenHead + res.data.data.token);
|
||||
that.$db.set('userInfos', res.data.data.userInfo);
|
||||
|
||||
@@ -520,7 +528,7 @@
|
||||
//this.logining = false;
|
||||
if (data) {
|
||||
console.log(data);
|
||||
that.login(data)
|
||||
that.login(data.userInfo)
|
||||
uni.setStorageSync('userInfos', data.userInfo);
|
||||
uni.setStorageSync('token', data.tokenHead + data.token);
|
||||
console.log(uni.getStorageSync('token'))
|
||||
@@ -545,7 +553,7 @@
|
||||
let data = await Api.apiCall('post', Api.index.login, params);
|
||||
if (data) {
|
||||
console.log(data);
|
||||
that.login(data);
|
||||
that.login(data.userInfo);
|
||||
uni.setStorageSync('userInfos', data.userInfo);
|
||||
uni.setStorageSync('token', data.tokenHead + data.token);
|
||||
// uni.setStorageSync('adminToken', data.tokenHead + data.token);
|
||||
@@ -588,7 +596,7 @@
|
||||
// 登录成功 记录会员信息到本地
|
||||
if (res) {
|
||||
console.log(res);
|
||||
that.login(res.data.data);
|
||||
that.login(res.data.data.userInfo);
|
||||
uni.setStorageSync('userInfos', res.data
|
||||
.data.userInfo);
|
||||
uni.setStorageSync('token', res.data.data
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
Api.apiCall('post', Api.index.logout, {});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
uni.removeStorageSync('userInfo');
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<view v-for="(item, index) in tabItem.orderList" :key="index" class="order-item" >
|
||||
<view class="i-top b-b">
|
||||
<text class="time" @click="navToDetailPage(item)">{{ item.createTime }}</text>
|
||||
<text class="state" :style="{ color: item.stateTipColor }" @click="navToDetailPage(item)">{{ item.id }}--</text>
|
||||
<!-- <text class="state" :style="{ color: item.stateTipColor }" @click="navToDetailPage(item)">{{ item.id }}--</text> -->
|
||||
<text class='state' v-if="item.status == 0">待审核</text>
|
||||
<text class='state' v-else-if="item.status == 1">退货中</text>
|
||||
<text class='state' v-else-if="item.status == 2">已完成</text>
|
||||
|
||||
@@ -178,6 +178,9 @@ export default {
|
||||
if (this.isFenxiao) {
|
||||
params.isFenxiao = 1;
|
||||
}
|
||||
|
||||
console.log("params>>>>",params)
|
||||
|
||||
let list = await Api.apiCall('get', Api.goods.goodsList, params);
|
||||
let goodsList = list.records;
|
||||
// let goodsList = await this.$api.json('goodsList');
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="c-list">
|
||||
<!-- <view class="c-list">
|
||||
<view class="c-row b-b" v-if="skuList && skuList.length > 0" @click="toggleSpec">
|
||||
<text class="tit">规格</text>
|
||||
<view class="con">
|
||||
@@ -77,10 +77,10 @@
|
||||
<text v-for="(item1, index1) in serviceList" :key="index1">{{ item1 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 评价 -->
|
||||
<view class="eva-section">
|
||||
<!-- <view class="eva-section">
|
||||
<view class="e-header">
|
||||
<text class="tit">评价</text>
|
||||
<text>({{ consultCount.all }})</text>
|
||||
@@ -106,7 +106,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="detail-desc">
|
||||
<view class="d-header"><text>图文详情</text></view>
|
||||
|
||||
@@ -158,7 +158,6 @@
|
||||
justify-content: space-between;
|
||||
|
||||
.listcard-content_title {
|
||||
padding-right: 30px;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
font-weight: 400;
|
||||
|
||||
@@ -14,13 +14,13 @@ const store = new Vuex.Store({
|
||||
console.log(provider);
|
||||
if (provider && provider != undefined) {
|
||||
console.log("provider", provider);
|
||||
console.log("provider>>>", provider.userInfo.memberLevelId);
|
||||
console.log("provider>>>", provider.memberLevelId);
|
||||
state.hasLogin = true;
|
||||
state.hasVip = provider.userInfo.memberLevelId == 1 ? false : true;
|
||||
state.hasVip = provider.memberLevelId == 1 ? false : true;
|
||||
console.log("state.hasVip >>>", state.hasVip);
|
||||
uni.setStorage({ //缓存用户登陆状态
|
||||
key: 'userInfo',
|
||||
data: provider.userInfo
|
||||
data: provider
|
||||
})
|
||||
state.userInfo = provider;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user