Browse Source

2023-02-28

功能完善
master
guoxing 2 years ago
parent
commit
d46da55237
  1. 73
      mallplusui-uniapp-app/App.vue
  2. 4
      mallplusui-uniapp-app/manifest.json
  3. 12
      mallplusui-uniapp-app/pages.json
  4. 20
      mallplusui-uniapp-app/pages/index/index.vue
  5. 21
      mallplusui-uniapp-app/pages/index/user.vue
  6. 2
      mallplusui-uniapp-app/pages/order/createOrder.vue
  7. 2
      mallplusui-uniapp-app/pages/order/createStoreOrder.vue
  8. 16
      mallplusui-uniapp-app/pages/order/order.vue
  9. 1021
      mallplusui-uniapp-app/pages/order/orderDetail.vue
  10. 22
      mallplusui-uniapp-app/pages/public/login.vue
  11. 1
      mallplusui-uniapp-app/pages/set/set.vue
  12. 2
      mallplusui-uniapp-app/pagesA/after_sale/list.vue
  13. 3
      mallplusui-uniapp-app/pagesA/product/list.vue
  14. 8
      mallplusui-uniapp-app/pagesA/product/product.vue
  15. 1
      mallplusui-uniapp-app/pagesU/notice/subjectList.vue
  16. 6
      mallplusui-uniapp-app/store/index.js

73
mallplusui-uniapp-app/App.vue

@ -11,26 +11,27 @@
} from 'vuex';
export default {
methods: {
...mapMutations(['login']) ,
// util.js
//
wxAuthorize() {
let link = window.location.href;
let params = this._getUrlParams(link); //
//
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;
}
},
...mapMutations(['login']),
// util.js
//
wxAuthorize() {
let link = window.location.href;
let params = this._getUrlParams(link); //
//
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;
}
},
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;

4
mallplusui-uniapp-app/manifest.json

@ -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,

12
mallplusui-uniapp-app/pages.json

@ -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",

20
mallplusui-uniapp-app/pages/index/index.vue

@ -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;

21
mallplusui-uniapp-app/pages/index/user.vue

@ -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({

2
mallplusui-uniapp-app/pages/order/createOrder.vue

@ -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 {

2
mallplusui-uniapp-app/pages/order/createStoreOrder.vue

@ -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 {

16
mallplusui-uniapp-app/pages/order/order.vue

@ -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);

1021
mallplusui-uniapp-app/pages/order/orderDetail.vue

File diff suppressed because it is too large

22
mallplusui-uniapp-app/pages/public/login.vue

@ -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

1
mallplusui-uniapp-app/pages/set/set.vue

@ -85,6 +85,7 @@
Api.apiCall('post', Api.index.logout, {});
setTimeout(() => {
uni.navigateBack();
uni.removeStorageSync('userInfo');
}, 200);
}
}

2
mallplusui-uniapp-app/pagesA/after_sale/list.vue

@ -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>

3
mallplusui-uniapp-app/pagesA/product/list.vue

@ -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');

8
mallplusui-uniapp-app/pagesA/product/product.vue

@ -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>

1
mallplusui-uniapp-app/pagesU/notice/subjectList.vue

@ -158,7 +158,6 @@
justify-content: space-between;
.listcard-content_title {
padding-right: 30px;
font-size: 14px;
color: #333;
font-weight: 400;

6
mallplusui-uniapp-app/store/index.js

@ -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;
}

Loading…
Cancel
Save