8 Commits

Author SHA1 Message Date
059017e787 fix: 更新开发环境的baseUrl配置,调整错误信息返回格式 2026-05-20 13:27:18 +08:00
0fbea2d669 feat: 新增退款相关功能 2026-05-09 11:10:12 +08:00
964017841e fix: 修复VIP价格计算逻辑,确保在价格不为null时进行计算。
将manifest.json中的版本号更新至1.2.88,移除ACCESS_COARSE_LOCATION和ACCESS_FINE_LOCATION权限。同时,在购物页面中修复VIP价格计算逻辑,确保在价格不为null时进行计算。
2026-04-21 13:19:01 +08:00
3bdb3c31a0 chore: 修改个人资料上传头像获取文件权限; 2026-04-21 13:18:15 +08:00
0299eab8d8 fix: 解决控制台报错 2026-03-27 10:22:44 +08:00
84484bf597 feat: 新增预售书重复购买提示
在结算页面中新增预售备注的弹窗功能,用户在结算时可查看相关备注信息。更新manifest.json中的版本号至1.2.87。
2026-03-25 11:40:40 +08:00
7c0308b991 chore: 修改学术传承分类 2026-03-24 18:51:49 +08:00
211bbbb6c2 fix: 更新阳经穴位属性及版本号
修正阳经穴位属性中的错误描述,将"脾经(土)"改为"胃经(土)","心(火)"改为"小肠(火)","后匾(母穴)"改为"后溪(母穴)"。同时更新应用版本号至1.2.85。
2026-03-24 17:27:24 +08:00
19 changed files with 1382 additions and 1688 deletions

View File

@@ -2,8 +2,9 @@ let baseUrl = "";
let socketUrl = ""; let socketUrl = "";
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
//开发环境 //开发环境
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试
// baseUrl = "https://api.nuttyreading.com/"; // 线上正式 // baseUrl = "https://api.nuttyreading.com/"; // 线上正式
baseUrl = "http://192.168.110.100:9200/pb/"; // 张川川 baseUrl = "http://192.168.110.131:9200/pb/"; // 后端本地
} else if (process.env.NODE_ENV === 'production') { } else if (process.env.NODE_ENV === 'production') {
//生产环境 //生产环境
baseUrl = "https://api.nuttyreading.com/"; baseUrl = "https://api.nuttyreading.com/";

View File

@@ -307,7 +307,8 @@ $http.dataFactory = async function(res) {
// 返回错误的结果(catch接受数据) // 返回错误的结果(catch接受数据)
return Promise.reject({ return Promise.reject({
statusCode: 0, statusCode: 0,
errMsg: "【request】" + (httpData.info || httpData.msg), // errMsg: "【request】" + (httpData.info || httpData.msg),
errMsg: (httpData.info || httpData.msg),
data: res.data data: res.data
}); });
} }

View File

@@ -96,6 +96,9 @@ Vue.component('common-goods-nav', commonGoodsNav);
import commonAdvertisement from '@/pages/component/commonComponents/advertisement.vue' import commonAdvertisement from '@/pages/component/commonComponents/advertisement.vue'
Vue.component('common-advertisement', commonAdvertisement); Vue.component('common-advertisement', commonAdvertisement);
import CommonRefundDestination from 'edu-core/components/order/refund-destination.vue'
Vue.component('common-refund-destination', CommonRefundDestination);
App.mpType = 'app' App.mpType = 'app'
const app = new Vue({ const app = new Vue({

View File

@@ -13,8 +13,8 @@
} }
], ],
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
"versionName" : "1.2.84", "versionName" : "1.2.89",
"versionCode" : 1284, "versionCode" : 1289,
"app-plus" : { "app-plus" : {
"compatible" : { "compatible" : {
"ignoreVersion" : true "ignoreVersion" : true
@@ -52,8 +52,6 @@
"permissions" : [ "permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
@@ -61,14 +59,12 @@
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.INSTALL_PACKAGES\"/>", "<uses-permission android:name=\"android.permission.INSTALL_PACKAGES\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>", "<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>", "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/>", "<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\"/>", "<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\"/>",
"<uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>", "<uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",

BIN
nuttyreading-html2.zip Normal file

Binary file not shown.

15
package-lock.json generated
View File

@@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"e-peanut": "file:", "e-peanut": "file:",
"edu-core": "git+https://git.nuttyreading.com/chenghuan/edu-core.git#v1.0.13",
"epubjs": "^0.3.93", "epubjs": "^0.3.93",
"jquery": "^2.2.4", "jquery": "^2.2.4",
"qs": "^6.11.0", "qs": "^6.11.0",
@@ -136,6 +137,11 @@
"resolved": "", "resolved": "",
"link": true "link": true
}, },
"node_modules/edu-core": {
"version": "1.0.13",
"resolved": "git+https://git.nuttyreading.com/chenghuan/edu-core.git#b5ece8b8abfeba98428f6e2191efae3312b5036f",
"license": "ISC"
},
"node_modules/epubjs": { "node_modules/epubjs": {
"version": "0.3.93", "version": "0.3.93",
"resolved": "https://registry.npmjs.org/epubjs/-/epubjs-0.3.93.tgz", "resolved": "https://registry.npmjs.org/epubjs/-/epubjs-0.3.93.tgz",
@@ -724,6 +730,7 @@
"requires": { "requires": {
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"e-peanut": "file:", "e-peanut": "file:",
"edu-core": "git+https://git.nuttyreading.com/chenghuan/edu-core.git#v1.0.13",
"epubjs": "^0.3.93", "epubjs": "^0.3.93",
"jquery": "^2.2.4", "jquery": "^2.2.4",
"qs": "^6.11.0", "qs": "^6.11.0",
@@ -815,6 +822,10 @@
"object-keys": "^1.1.1" "object-keys": "^1.1.1"
} }
}, },
"edu-core": {
"version": "git+https://git.nuttyreading.com/chenghuan/edu-core.git#b5ece8b8abfeba98428f6e2191efae3312b5036f",
"from": "edu-core@git+https://git.nuttyreading.com/chenghuan/edu-core.git#v1.0.13"
},
"epubjs": { "epubjs": {
"version": "0.3.93", "version": "0.3.93",
"resolved": "https://registry.npmjs.org/epubjs/-/epubjs-0.3.93.tgz", "resolved": "https://registry.npmjs.org/epubjs/-/epubjs-0.3.93.tgz",
@@ -1224,6 +1235,10 @@
} }
} }
}, },
"edu-core": {
"version": "git+https://git.nuttyreading.com/chenghuan/edu-core.git#b5ece8b8abfeba98428f6e2191efae3312b5036f",
"from": "edu-core@git+https://git.nuttyreading.com/chenghuan/edu-core.git#v1.0.13"
},
"epubjs": { "epubjs": {
"version": "0.3.93", "version": "0.3.93",
"resolved": "https://registry.npmjs.org/epubjs/-/epubjs-0.3.93.tgz", "resolved": "https://registry.npmjs.org/epubjs/-/epubjs-0.3.93.tgz",

View File

@@ -7,6 +7,7 @@
"dependencies": { "dependencies": {
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"e-peanut": "file:", "e-peanut": "file:",
"edu-core": "git+https://git.nuttyreading.com/chenghuan/edu-core.git#v1.0.13",
"epubjs": "^0.3.93", "epubjs": "^0.3.93",
"jquery": "^2.2.4", "jquery": "^2.2.4",
"qs": "^6.11.0", "qs": "^6.11.0",

View File

@@ -264,6 +264,13 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "pages/bookShop/refundDestination",
"style": {
"navigationBarTitleText": "钱款去向",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/bookShop/commoditySearch", "path": "pages/bookShop/commoditySearch",
"style": { "style": {

View File

@@ -66,11 +66,11 @@
SunList: { SunList: {
title: '阳经', title: '阳经',
vlue: '属性', vlue: '属性',
attribute: ['阳经', '属性', '大肠经(金)', '经(土)', '(火)', '膀胱经(水)', '三焦经(冬至前相火,冬至后相水)', '胆经(木)'], attribute: ['阳经', '属性', '大肠经(金)', '经(土)', '小肠(火)', '膀胱经(水)', '三焦经(冬至前相火,冬至后相水)', '胆经(木)'],
arry: [ arry: [
['井', '金', '商阳(本穴)', '厉兑(子穴)', '少泽', '至阴(母穴)', '关冲(冬至后母穴)', '窍阴'], ['井', '金', '商阳(本穴)', '厉兑(子穴)', '少泽', '至阴(母穴)', '关冲(冬至后母穴)', '窍阴'],
['荥', '水', '二间(子穴)', '内庭(泄井当泄荥)', '前谷', '通谷(本穴)', '液门(冬至后本穴)', '侠溪(母穴)'], ['荥', '水', '二间(子穴)', '内庭(泄井当泄荥)', '前谷', '通谷(本穴)', '液门(冬至后本穴)', '侠溪(母穴)'],
['俞', '木', '三间', '陷谷', '后(母穴)', '束骨(子穴)', '中渚(冬至前回穴,冬至后子穴)', '临泣(本穴)'], ['俞', '木', '三间', '陷谷', '后(母穴)', '束骨(子穴)', '中渚(冬至前回穴,冬至后子穴)', '临泣(本穴)'],
['经', '火', '阳溪', '解溪(母穴)', '阳谷(本穴)', '昆仑', '支沟(冬至前本穴)', '阳辅(子穴)'], ['经', '火', '阳溪', '解溪(母穴)', '阳谷(本穴)', '昆仑', '支沟(冬至前本穴)', '阳辅(子穴)'],
['合', '土', '曲池(母穴)', '足三里(本穴)', '小海(子穴)', '委中(补井当补合)', '天井(冬至前子穴)', '阳陵泉'], ['合', '土', '曲池(母穴)', '足三里(本穴)', '小海(子穴)', '委中(补井当补合)', '天井(冬至前子穴)', '阳陵泉'],
['原', '', '合谷', '冲阳', '腕骨', '京骨', '阳池', '丘墟'], ['原', '', '合谷', '冲阳', '腕骨', '京骨', '阳池', '丘墟'],

View File

@@ -31,6 +31,8 @@
<text class="orderState orderState2" v-if="orderContet.orderStatus==2">待收到</text> <text class="orderState orderState2" v-if="orderContet.orderStatus==2">待收到</text>
<text class="orderState orderState3" v-if="orderContet.orderStatus==3">已完成</text> <text class="orderState orderState3" v-if="orderContet.orderStatus==3">已完成</text>
<text class="orderState orderState5" v-if="orderContet.orderStatus==5">已超时</text> <text class="orderState orderState5" v-if="orderContet.orderStatus==5">已超时</text>
<text class="orderState orderState6" v-if="orderContet.orderStatus==6">已退款</text>
<text class="orderState orderState7" v-if="orderContet.orderStatus==7">退款中</text>
</view> </view>
<template v-if="orderContet.orderType == 'order' && orderContet.goodsList.length > 0"> <template v-if="orderContet.orderType == 'order' && orderContet.goodsList.length > 0">
<view style="position: relative;" class="orderContent" v-for="(item,index) in orderContet.goodsList" :key="index" <view style="position: relative;" class="orderContent" v-for="(item,index) in orderContet.goodsList" :key="index"
@@ -140,7 +142,8 @@
<view v-if="orderContet.orderStatus==2 && sheetList.length > 0 && orderContet.orderStatus != 5" class="opFix" @click="seeExpressDetail(orderContet)">查看物流</view> <view v-if="orderContet.orderStatus==2 && sheetList.length > 0 && orderContet.orderStatus != 5" class="opFix" @click="seeExpressDetail(orderContet)">查看物流</view>
<view v-if="orderContet.orderStatus==2" class="opCan" @click="OverOrder" >确认收到</view> <view v-if="orderContet.orderStatus==2" class="opCan" @click="OverOrder" >确认收到</view>
<view v-if="orderContet.orderStatus==0" class="opFix" @click="canceOrder">取消订单</view> <!-- nuttyreading注释取消订单入口 -->
<!-- <view v-if="orderContet.orderStatus==0" class="opFix" @click="canceOrder">取消订单</view> -->
<view v-if="orderContet.orderStatus==0" class="opCan" @click="goPay(orderContet)">去支付</view> <view v-if="orderContet.orderStatus==0" class="opCan" @click="goPay(orderContet)">去支付</view>
<view class="opCan" @click="kefu">联系客服</view> <view class="opCan" @click="kefu">联系客服</view>
@@ -629,6 +632,10 @@
this.titleStat = '待收到' this.titleStat = '待收到'
} else if (this.orderContet.orderStatus == 3) { } else if (this.orderContet.orderStatus == 3) {
this.titleStat = '已完成' this.titleStat = '已完成'
} else if (this.orderContet.orderStatus == 6) {
this.titleStat = '已退款'
} else if (this.orderContet.orderStatus == 7) {
this.titleStat = '退款中'
} }
if(this.orderContet.orderStatus >= 2 && this.orderContet.orderType == 'order' && this.orderContet.expressOrders != null){ if(this.orderContet.orderStatus >= 2 && this.orderContet.orderType == 'order' && this.orderContet.expressOrders != null){
this.sheetList = this.orderContet.expressOrders this.sheetList = this.orderContet.expressOrders
@@ -665,11 +672,29 @@
} }
}); });
}, },
checkPayTimeout(payItem) {
const createTime = payItem && payItem.createTime;
if (!createTime) return true;
const createdAt = new Date(String(createTime).replace(/-/g, "/")).getTime();
if (!createdAt) return true;
const expired = Date.now() - createdAt > 10 * 60 * 1000;
if (expired) {
uni.showModal({
title: "提示",
content: "订单已超时,不能继续支付,请重新下单",
confirmText: "知道了",
showCancel: false
});
return false;
}
return true;
},
// 支付 // 支付
goPay(payItem) { goPay(payItem) {
console.log(payItem,'订单数据') console.log(payItem,'订单数据')
if(!this.checkPayTimeout(payItem)) return
if(payItem.paymentMethod == 2){ if(payItem.paymentMethod == 2){
console.log('阿里支付') console.log('阿里支付')
setPay({ setPay({
@@ -776,6 +801,8 @@
.orderState2{background-color: #f56c6c;} .orderState2{background-color: #f56c6c;}
.orderState3{background-color: #67c23a;} .orderState3{background-color: #67c23a;}
.orderState5{background-color: #787878;} .orderState5{background-color: #787878;}
.orderState6{background-color: #f56c6c;}
.orderState7{background-color: #f56c6c;}
.guoqi{ font-size: 28rpx; align-items: center; color: red; float: right; line-height: 40rpx;} .guoqi{ font-size: 28rpx; align-items: center; color: red; float: right; line-height: 40rpx;}
.star{display: inline-block; width: 20px; height: 20px; margin-right: 10rpx;} .star{display: inline-block; width: 20px; height: 20px; margin-right: 10rpx;}
.starGray{ background : url(../../static/icon/star_greey.png) no-repeat; background-size: contain; } .starGray{ background : url(../../static/icon/star_greey.png) no-repeat; background-size: contain; }

View File

@@ -1,27 +1,25 @@
<template> <template>
<view class="container"> <view class="">
<!-- 公共组件-每个页面必须引入 --> <!-- 公共组件-每个页面必须引入 -->
<public-module></public-module> <public-module></public-module>
<view class="header"> <view class="header">
<!-- 顶部导航栏 --> <!-- 顶部导航栏 -->
<z-nav-bar backState="2000" title="我的订单"></z-nav-bar> <z-nav-bar backState="2000" title="我的订单"></z-nav-bar>
<view class="ordersTabs"> <view class="ordersTabs">
<view v-for="(item,index) in ordersTabs" @click="ordersTabCLi(item.value)" :key="index" <u-tabs
:class="ordersListTab==item.value?'ordersdefine ordStyle':'ordersdefine'"> :list="ordersTabs"
{{item.name}} :current="currentTabIndex"
<view class="ordersnum" v-if="item.value == 0 && map[item.value] > 0">{{map[item.value]}}</view> lineColor="#3c7f56"
<view class="ordersnum" v-if="item.value == 1 && map[item.value] > 0">{{map[item.value]}}</view> activeStyle="color: #3c7f56; font-weight: bold;"
<view class="ordersnum" v-if="item.value == 2 && map[item.value] > 0">{{map[item.value]}}</view> inactiveStyle="color: #333;"
</view> @click="ordersTabCLi"
></u-tabs>
</view> </view>
</view> </view>
<!-- 站位 --> <!-- 站位 -->
<view class="ordersTabs" style="z-index:0;position:unset;"> <view class="ordersTabsPlaceholder"></view>
<view class="ordersdefine">1</view>
</view>
<!-- <view v-if="ordersListTab == 1"> --> <!-- <view v-if="ordersListTab == 1"> -->
<view> <view v-if="newList.length > 0" class="container">
<view v-if="newList.length > 0">
<view class="orderInfo" v-for="(item,index) in newList" :key="index"> <view class="orderInfo" v-for="(item,index) in newList" :key="index">
<view class="mainContent"> <view class="mainContent">
<view class="item" @click.stop="toDetail(item)"> <view class="item" @click.stop="toDetail(item)">
@@ -31,19 +29,21 @@
<view class="orderstatus" v-show="item.orderStatus == 3">交易成功</view> <view class="orderstatus" v-show="item.orderStatus == 3">交易成功</view>
<view class="orderstatus" v-show="item.orderStatus == 4">交易失败</view> <view class="orderstatus" v-show="item.orderStatus == 4">交易失败</view>
<view class="orderstatus" v-show="item.orderStatus == 5">过期</view> <view class="orderstatus" v-show="item.orderStatus == 5">过期</view>
<view class="orderstatus" v-show="item.orderStatus == 6">已退款</view>
<view class="orderstatus" v-show="item.orderStatus == 7">退款中</view>
<template v-if="item.orderType == 'order'"> <template v-if="item.orderType == 'order'">
<view style="position: relative;" v-for="(item1,index1) in item.productList" :key="index1" class="bookinfolist"> <view style="position: relative;" v-for="(item1,index1) in item.productList" :key="index1" class="bookinfolist">
<!-- <!--
<span v-if="item1.product.isVipPrice==1&&item1.product.vipPrice!=0&&item1.vipPrice!=null" <span v-if="item1.product.isVipPrice==1&&item1.product.vipPrice!=0&&item1.vipPrice!=null"
style="position: absolute;z-index: 10;top: 4px;left: 0px;margin-right: 10px;text-align: center;font-size: 18rpx;background-color: #f94f04;color: #fff;font-weight: bold;border-radius:4px;width: 80rpx; padding:2px 4px;box-sizing: border-box;">VIP优惠</span> style="position: absolute;z-index: 10;top: 4px;left: 0px;margin-right: 10px;text-align: center;font-size: 18rpx;background-color: #f94f04;color: #fff;font-weight: bold;border-radius:4px;width: 80rpx; padding:2px 4px;box-sizing: border-box;">VIP优惠</span>
--> -->
<image class="feng" v-if="item1.product.productImages" :src="item1.product.productImages" mode="aspectFill"></image> <image class="feng" v-if="item1.product && item1.product.productImages" :src="item1.product.productImages" mode="aspectFill"></image>
<!-- <view class="description" v-html="item.content"> <!-- <view class="description" v-html="item.content">
</view> --> </view> -->
<view class="btns flexbox"> <view class="btns flexbox">
<span class="booknameleft">{{item1.product.productName}}</span> <span class="booknameleft">{{item1.product && item1.product.productName}}</span>
<span class="right flexbox opbtns"> <span class="right flexbox opbtns">
¥{{item1.product.price}} ¥{{item1.product && item1.product.price}}
</span> </span>
</view> </view>
<view class="btns flexbox" style="margin-top:10rpx;padding-bottom: 72rpx;"> <view class="btns flexbox" style="margin-top:10rpx;padding-bottom: 72rpx;">
@@ -88,11 +88,13 @@
<view class="btns flexbox" style="margin-top:10rpx;"> <view class="btns flexbox" style="margin-top:10rpx;">
<span class="left" style="color: #C0C4CC;" @click.stop="toDetail(item)">订单详情</span> <span class="left" style="color: #C0C4CC;" @click.stop="toDetail(item)">订单详情</span>
<span class="right flexbox opbtns"> <span class="right flexbox opbtns">
<view class="orderstatusbtn" v-if="item.orderStatus == 0" @click.stop="canceOrder(item)">取消订单</view> <!-- <view class="orderstatusbtn" v-if="item.orderStatus == 0" @click.stop="canceOrder(item)">取消订单</view> -->
<view class="orderstatusbtn" v-if="item.orderStatus == 0" @click.stop="goPay(item)">付款</view> <view class="orderstatusbtn" v-if="item.orderStatus == 0" @click.stop="goPay(item)">付款</view>
<!-- <view class="orderstatusbtn alertDeliver" v-if="item.orderStatus == 1">催发出</view> --> <!-- <view class="orderstatusbtn alertDeliver" v-if="item.orderStatus == 1">催发出</view> -->
<view class="orderstatusbtn" v-if="item.orderStatus == 2" @click.stop="seeExpressDetail(item)">查看物流</view> <view class="orderstatusbtn" v-if="item.orderStatus == 2" @click.stop="seeExpressDetail(item)">查看物流</view>
<view class="orderstatusbtn" v-if="item.orderStatus == 2" @click.stop="OverOrder(item)">确认收到</view> <view class="orderstatusbtn" v-if="item.orderStatus == 2" @click.stop="OverOrder(item)">确认收到</view>
<view class="orderstatusbtn" v-if="item.orderStatus == 6 || item.orderStatus == 7" @click.stop="goRefundDestination(item)">钱款去向</view>
<view class="orderstatusbtn" v-if="item.refundableStatus === true" @click.stop="confirmApplyRefund(item)">申请退款</view>
<!-- <view class="orderstatusbtn" v-if="item.orderStatus == 3">申请售后</view> --> <!-- <view class="orderstatusbtn" v-if="item.orderStatus == 3">申请售后</view> -->
<!-- --> <!-- -->
<!-- <view class="orderstatusbtn" v-if=" userRecordid == null && item.come == 0" @click.stop="pingji(item.id)">评价</view> --> <!-- <view class="orderstatusbtn" v-if=" userRecordid == null && item.come == 0" @click.stop="pingji(item.id)">评价</view> -->
@@ -104,12 +106,11 @@
</view> </view>
</view> </view>
</view> </view>
</view> <view v-if="status==0" class="container" style="text-align: center;">
<view v-if="status==0" style="text-align: center;">
<u-loading-icon style="display: inline-block;"></u-loading-icon> <u-loading-icon style="display: inline-block;"></u-loading-icon>
<font style='vertical-align: super;margin-left: 10px;font-size: 26rpx;color: #909399;'>努力加载中</font> <font style='vertical-align: super;margin-left: 10px;font-size: 26rpx;color: #909399;'>努力加载中</font>
</view> </view>
<view v-if="status==1" style="padding-bottom: 20rpx;"> <view v-if="status==1" class="container" style="padding-bottom: 20rpx;">
<u-divider v-if="newList.length > 0" text="全部加载完成"></u-divider> <u-divider v-if="newList.length > 0" text="全部加载完成"></u-divider>
<u-divider v-else text="暂无订单"></u-divider> <u-divider v-else text="暂无订单"></u-divider>
</view> </view>
@@ -201,21 +202,35 @@ import { data } from 'jquery';
bfaid:null, bfaid:null,
ordersTabs: [{ ordersTabs: [{
name: '全部', name: '全部',
value: null value: -1,
badge: {}
}, { }, {
name: '待付款', name: '待付款',
value: 0 value: 0,
badge: {}
}, { }, {
name: '待发出', name: '待发出',
value: 1 value: 1,
badge: {}
}, { }, {
name: '待收到', name: '待收到',
value: 2 value: 2,
badge: {}
}, { }, {
name: '已完成', name: '已完成',
value: 3 value: 3,
badge: {}
}, {
name: '已退款',
value: 6,
badge: {}
}, {
name: '退款中',
value: 7,
badge: {}
}], }],
ordersListTab: 1, ordersListTab: 1,
currentTabIndex: 0,
newestpage: 1, newestpage: 1,
// hotestpage: 1, // hotestpage: 1,
// booksetpage: 1, // booksetpage: 1,
@@ -266,8 +281,10 @@ import { data } from 'jquery';
methods: { methods: {
...mapMutations(['setLoadingShow']), ...mapMutations(['setLoadingShow']),
// 切换tab状态 // 切换tab状态
ordersTabCLi(e) { ordersTabCLi(tabItem) {
this.ordersListTab = e const isObject = tabItem && typeof tabItem === 'object';
this.currentTabIndex = isObject ? (tabItem.index || 0) : 0;
this.ordersListTab = isObject ? tabItem.value : tabItem;
this.newestpage = 1 this.newestpage = 1
// this.hotestpage = 1 // this.hotestpage = 1
// this.booksetpage = 1 // this.booksetpage = 1
@@ -276,6 +293,16 @@ import { data } from 'jquery';
// this.bookList = [] // this.bookList = []
this.getBookList(this.ordersListTab, false) this.getBookList(this.ordersListTab, false)
}, },
updateOrdersTabBadge() {
this.ordersTabs.forEach((tab) => {
if (tab.value === 0 || tab.value === 1 || tab.value === 2) {
const count = Number(this.map && this.map[tab.value]) || 0;
tab.badge = count > 0 ? { value: count } : {};
} else {
tab.badge = {};
}
});
},
// 查看本书更多书评 // 查看本书更多书评
toMore(val){ toMore(val){
console.log(val,'val') console.log(val,'val')
@@ -293,6 +320,47 @@ import { data } from 'jquery';
url: './orderLCont?orderId=' + val.orderId + '&orderType=' + val.orderStatus + '&orderSn=' + val.orderSn url: './orderLCont?orderId=' + val.orderId + '&orderType=' + val.orderStatus + '&orderSn=' + val.orderSn
}); });
}, },
goRefundDestination(row) {
uni.navigateTo({
url: `/pages/bookShop/refundDestination?orderId=${row.orderId}`,
});
},
confirmApplyRefund(row) {
uni.showModal({
title: '申请退款',
content: '请确认是否提交退款申请?',
confirmText: '确认提交',
cancelText: '取消',
success: (res) => {
if (res.confirm) {
this.submitOrderRefund(row);
}
}
});
},
submitOrderRefund(orderRow) {
this.$http.request({
url: "book/buyOrder/refundOrder",
method: "POST",
data: {
orderId: orderRow.orderId
},
header: {
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code === 0) {
this.$commonJS.showToast('申请退款成功');
this.newestpage = 1;
this.newList = [];
this.getBookList(this.ordersListTab, false);
return;
}
this.$commonJS.showToast(res.errMsg || '申请退款失败');
}).catch(() => {
this.$commonJS.showToast('申请退款失败');
});
},
getBookList(flag, refreshflag){ getBookList(flag, refreshflag){
// 根据tab不同获取最新书评、最热书评、书集列表 // 根据tab不同获取最新书评、最热书评、书集列表
uni.showLoading({ uni.showLoading({
@@ -311,13 +379,14 @@ import { data } from 'jquery';
}, },
}).then(res => { }).then(res => {
this.map = res.map this.map = res.map
this.updateOrdersTabBadge()
}).catch(e => { }).catch(e => {
console.log(e) console.log(e)
}) })
var params = { var params = {
"userId": this.userInfo.id, "userId": this.userInfo.id,
"orderStatus":flag,//传null为全部订单状态 0-未付款 1-待发出 2-待收到 3-交易成功 4-交易失败 5-过期 "orderStatus": flag == -1 ? null : flag,//传null为全部订单状态 0-未付款 1-待发出 2-待收到 3-交易成功 4-交易失败 5-过期 6-已退款 7-退款中
"limit": 10, "limit": 10,
"page": this.newestpage "page": this.newestpage
} }
@@ -348,9 +417,27 @@ import { data } from 'jquery';
console.log(e) console.log(e)
}) })
}, },
checkPayTimeout(payItem) {
const createTime = payItem && payItem.createTime;
if (!createTime) return true;
const createdAt = new Date(String(createTime).replace(/-/g, "/")).getTime();
if (!createdAt) return true;
const expired = Date.now() - createdAt > 10 * 60 * 1000;
if (expired) {
uni.showModal({
title: "提示",
content: "订单已超时,不能继续支付,请重新下单",
confirmText: "知道了",
showCancel: false
});
return false;
}
return true;
},
// 支付 // 支付
goPay(payItem) { goPay(payItem) {
console.log(payItem,'订单数据') console.log(payItem,'订单数据')
if(!this.checkPayTimeout(payItem)) return
if(payItem.paymentMethod == 2){ if(payItem.paymentMethod == 2){
console.log('阿里支付') console.log('阿里支付')
setPay({ setPay({
@@ -688,42 +775,14 @@ import { data } from 'jquery';
<style lang="scss" scoped> <style lang="scss" scoped>
// @import '@/style/mixin.scss'; // @import '@/style/mixin.scss';
.ordersTabs { .ordersTabs {
// margin: 70rpx 0 0 0;
width: 730rpx;
// padding: 0 3% 3% 3%;
position: fixed; position: fixed;
// top: 80rpx;
background-color: #f7faf9; background-color: #f7faf9;
z-index: 100; z-index: 100;
padding: 0 20rpx;
.ordersdefine { }
display: inline-block; .ordersTabsPlaceholder {
padding: 20rpx 0 20rpx 0; width: 100%;
// margin: 40rpx 0 15rpx 0; height: 88rpx;
width:140rpx;
text-align: center;
font-size: 30rpx;
position: relative;
.ordersnum{
position: absolute;
top: 8rpx;
right: 0rpx;
background-color: red;
// border:1rpx solid #a3a3a3;
border-radius: 40rpx;
width: 28rpx;
height: 28rpx;
font-size: 20rpx;
font-weight: 500;
color: rgb(255, 255, 255);
}
}
.ordStyle {
// border-bottom: 4rpx solid #54a966;
// color: #54a966;
font-weight: bold;
}
} }
.orderstatusbtn{ .orderstatusbtn{
color: #000; color: #000;

View File

@@ -0,0 +1,27 @@
<template>
<view class="page-wrap">
<public-module></public-module>
<common-refund-destination :order-id="orderId" :http="$http" />
</view>
</template>
<script>
export default {
data() {
return {
orderId: "",
};
},
onLoad(options) {
if (options && options.orderId != null) {
this.orderId = options.orderId;
}
},
};
</script>
<style scoped>
.page-wrap {
min-height: 100vh;
}
</style>

View File

@@ -374,6 +374,18 @@
</view> </view>
</u-popup> </u-popup>
<u-modal
:show="presaleRemarkModalShow"
title="提示"
:content="presaleRemarkModalContent"
:showCancelButton="true"
confirmText="继续购买"
cancelText="取消"
@confirm="handlePresaleRemarkConfirm"
@cancel="handlePresaleRemarkCancel"
@close="handlePresaleRemarkCancel"
></u-modal>
<music-play :playData="playData"></music-play> <music-play :playData="playData"></music-play>
</view> </view>
</template> </template>
@@ -413,6 +425,9 @@ export default {
realPrice: 0, realPrice: 0,
payType: 1, payType: 1,
nowClick: true, nowClick: true,
presaleRemarkModalShow: false,
presaleRemarkModalContent: "",
presaleRemarkModalResolve: null,
paylist: [ paylist: [
{ {
title: "支付宝", title: "支付宝",
@@ -556,6 +571,59 @@ export default {
} }
}, },
// 获取优惠券列表 // 获取优惠券列表
openPresaleRemarkModal(content) {
this.presaleRemarkModalContent = content;
this.presaleRemarkModalShow = true;
return new Promise((resolve) => {
this.presaleRemarkModalResolve = resolve;
});
},
handlePresaleRemarkConfirm() {
this.presaleRemarkModalShow = false;
if (this.presaleRemarkModalResolve) {
const resolve = this.presaleRemarkModalResolve;
this.presaleRemarkModalResolve = null;
resolve(true);
}
},
handlePresaleRemarkCancel() {
this.presaleRemarkModalShow = false;
if (this.presaleRemarkModalResolve) {
const resolve = this.presaleRemarkModalResolve;
this.presaleRemarkModalResolve = null;
resolve(false);
}
},
async checkPresaleRemark() {
const productIds = this.cartList
.map((e) => e.productId)
.filter((id) => id)
.join(",");
if (!productIds) {
return true;
}
try {
const res = await $http.request({
url: "book/buyOrder/presaleRemark",
method: "POST",
data: {
productIds,
},
header: {
"Content-Type": "application/json",
},
});
const remark =
res && typeof res.remark == "string" ? res.remark.trim() : "";
if (!remark) {
return true;
}
return await this.openPresaleRemarkModal(remark);
} catch (error) {
console.log("presaleRemark error:", error);
return true;
}
},
getCourpe() { getCourpe() {
let proId = ""; let proId = "";
for (let i = 0; i < this.cartList.length; i++) { for (let i = 0; i < this.cartList.length; i++) {
@@ -894,7 +962,7 @@ export default {
this.youhuiShow = false; this.youhuiShow = false;
}, },
// 提交结算 // 提交结算
goBuyJie() { async goBuyJie() {
if (this.addressList.length == 0) { if (this.addressList.length == 0) {
this.dizhiShow = true; // 如果没有地址信息 this.dizhiShow = true; // 如果没有地址信息
return; return;
@@ -923,6 +991,11 @@ export default {
quantity: this.cartList[i].productAmount, quantity: this.cartList[i].productAmount,
}); });
} }
const passPresaleRemark = await this.checkPresaleRemark();
if (!passPresaleRemark) {
this.nowClick = true;
return;
}
let data = { let data = {
buyType: this.typeId, //0- 商品页直接下单 1- 购物车结算 buyType: this.typeId, //0- 商品页直接下单 1- 购物车结算
userId: this.userInfo.id, //下单人ID userId: this.userInfo.id, //下单人ID

View File

@@ -69,6 +69,12 @@
<text <text
class="orderState orderState5" class="orderState orderState5"
v-if="orderContet.orderStatus == 5">已超时</text> v-if="orderContet.orderStatus == 5">已超时</text>
<text
class="orderState orderState6"
v-if="orderContet.orderStatus == 6">已退款</text>
<text
class="orderState orderState7"
v-if="orderContet.orderStatus == 7">退款中</text>
</view> </view>
<view <view
class="orderContent" class="orderContent"
@@ -615,14 +621,15 @@ export default {
text: "继续付款", text: "继续付款",
}); });
} }
if (this.orderContet.orderStatus == 0) { // nuttyreading注释取消订单按钮
this.customButton.push({ // if (this.orderContet.orderStatus == 0) {
width: "160rpx", // this.customButton.push({
text: "取消订单", // width: "160rpx",
color: "#333", // text: "取消订单",
backgroundColor: "#f0f0f0", // color: "#333",
}); // backgroundColor: "#f0f0f0",
} // });
// }
if (this.orderContet.orderStatus == 0) { if (this.orderContet.orderStatus == 0) {
this.titleStat = "待支付"; this.titleStat = "待支付";
} else if (this.orderContet.orderStatus == 1) { } else if (this.orderContet.orderStatus == 1) {
@@ -631,6 +638,10 @@ export default {
this.titleStat = "待收到"; this.titleStat = "待收到";
} else if (this.orderContet.orderStatus == 3) { } else if (this.orderContet.orderStatus == 3) {
this.titleStat = "已完成"; this.titleStat = "已完成";
} else if (this.orderContet.orderStatus == 6) {
this.titleStat = "已退款";
} else if (this.orderContet.orderStatus == 7) {
this.titleStat = "退款中";
} }
if ( if (
this.orderContet.orderStatus >= 2 && this.orderContet.orderStatus >= 2 &&
@@ -810,6 +821,12 @@ view,uni-view {
.orderState5 { .orderState5 {
background-color: #787878; background-color: #787878;
} }
.orderState6 {
background-color: #f56c6c;
}
.orderState7 {
background-color: #f56c6c;
}
.guoqi { .guoqi {
font-size: 28rpx; font-size: 28rpx;
align-items: center; align-items: center;

File diff suppressed because it is too large Load Diff

View File

@@ -165,7 +165,7 @@
this.cartList.forEach((item, index) => { this.cartList.forEach((item, index) => {
let price = 0; let price = 0;
if (item.checked) { if (item.checked) {
if (item.isVipPrice == 1 && item.vipPrice != 0) { if (item.isVipPrice == 1 && item.vipPrice != 0 && item.vipPrice != null) {
price = (item.productAmount * item.vipPrice).toFixed(2); price = (item.productAmount * item.vipPrice).toFixed(2);
} else { } else {
if (item.activityPrice && item.activityPrice > 0) { if (item.activityPrice && item.activityPrice > 0) {

View File

@@ -35,7 +35,7 @@
<view class="AC_jilu PM_font">充值消费记录</view> <view class="AC_jilu PM_font">充值消费记录</view>
<view v-for="(item,index) in MoneyRecord" class="AC_List" @click="goClick(item)"> <view v-for="(item,index) in MoneyRecord" class="AC_List" @click="goClick(item)">
<view class="AC_title"> <view class="AC_title">
{{item.orderType}} {{ item.productName || item.orderType}}
<view> <view>
<text v-if="item.changeAmount>0">+</text> <text v-if="item.changeAmount>0">+</text>
<text>{{item.changeAmount}}</text> <text>{{item.changeAmount}}</text>

View File

@@ -1,850 +1,93 @@
<template> <template>
<view> <view class="container commonPageBox">
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module> <public-module></public-module>
<z-nav-bar title="个人资料"></z-nav-bar> <z-nav-bar title="个人资料"></z-nav-bar>
<view class="tabulate"> <UserInfo
<view class="per_list"> :userInfo="userInfo"
<text class="biaoti">手机号</text> :$http="$http"
<text class="neirong">{{userMsage.tel}}</text> :dataList="dataList"
<text class="marPer" v-if="!userMsage.tel" @click="phoneShow = true;OpenClear()" @show-submit-info="onShowSubmitInfo"
style="background-color: #ed901d;">点击绑定</text> @close-submit-info="closeManager"
</view> ></UserInfo>
<view class="per_list">
<text class="biaoti">邮箱</text>
<text class="neirong">{{userMsage.email}}</text>
<text class="marPer" v-if="!userMsage.email" @click="emailShow = true;OpenClear()"
style="background-color: #ed901d;">点击绑定</text>
</view>
<view class="per_list per_list_arrow" @click="avatarShow = true">
<text class="biaoti" style="margin-top: 40rpx;">头像</text>
<text class="neirong" style="margin-top: 0;">
<image :src="userMsage.avatar" class="per_mes_img"></image>
</text>
</view>
<view class="per_list per_list_arrow" @click="nicknameShow = true">
<text class="biaoti">昵称</text>
<text class="neirong">{{userMsage.nickname}}</text>
</view>
<view class="per_list per_list_arrow" @click="passwordShow = true">
<text class="biaoti">密码</text>
<text v-if="userMsage.YNpass!=''" class="neirong">点击修改</text>
<text class="marPer" v-if="userMsage.YNpass!=''"
style="background-color: #92c78c;margin-right: 40rpx;">已设定</text>
<text v-if="userMsage.YNpass==''" class="neirong">去设置</text>
<text class="marPer" v-if="userMsage.YNpass==''"
style="background-color: #9d9d9d;margin-right: 40rpx;">未设定</text>
</view>
<view class="per_list per_list_arrow" @click="ageShow = true">
<text class="biaoti">年龄</text>
<text class="neirong">{{userMsage.age}}</text>
</view>
<view class="per_list per_list_arrow" @click="sexShow = true">
<text class="biaoti">性别</text>
<text class="neirong" v-if="userMsage.sex==1"></text>
<text class="neirong" v-if="userMsage.sex==0"></text>
</view>
</view>
<!-- 手机 -->
<u-popup :show="phoneShow" :round="10" @close="phoneShow=false;">
<view class="tanchu">
<view class="dp_title">请输入手机号</view>
<view style="display: flex;">
<view class="quhao">
<uni-data-select class="quhaoSel" placeholder="请选择区号" v-model="userMes.quCode"
:localdata="quCodeList"></uni-data-select>
</view> <u--input v-model="userMes.phone" placeholder="请输入手机号" border="surround" clearable>
</u--input>
</view>
<view style="display: flex;">
<u--input v-model="userMes.phonecode" type="number" placeholder="请输入验证码" border="surround" clearable
style="margin-top: 20rpx;">
</u--input>
<button class="emPHCode" @click="onSetCode('phone')">{{ PhoneEmailNote }}</button>
</view>
<u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定" @click="chosePhone()"
style="margin-top: 50rpx;"></u-button>
<view @click="phoneShow=false" class="dp_canBtn">
取消</view>
</view>
</u-popup>
<!-- 邮箱 -->
<u-popup :show="emailShow" :round="10" @close="emailShow=false;PhoneEmailNote = '获取验证码'">
<view class="tanchu">
<view class="dp_title">请输入邮箱</view>
<u--input v-model="userMes.email" placeholder="请输入邮箱" border="surround" clearable>
</u--input>
<view style="display: flex;">
<u--input v-model="userMes.emailcode" type="number" placeholder="请输入验证码" border="surround" clearable
style="margin-top: 20rpx;">
</u--input>
<button class="emPHCode" @click="onSetCode('email')">{{ PhoneEmailNote }}</button>
</view>
<u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定" @click="choseEmail()"
style="margin-top: 50rpx;"></u-button>
<view @click="emailShow=false" class="dp_canBtn">
取消</view>
</view>
</u-popup>
<!-- 头像 -->
<u-popup :show="avatarShow" :round="10" @close="avatarShow=false">
<view class="tanchu">
<view class="dp_title">请更换头像</view>
<u-upload :fileList="fileAvatar" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="1"
width="150" height="150" :previewFullImage="true">
</u-upload>
<u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定" @click="choseAvatar()"
style="margin-top: 50rpx;"></u-button>
<view @click="avatarShow=false" class="dp_canBtn">取消</view>
</view>
</u-popup>
<!-- 昵称 -->
<u-popup :show="nicknameShow" :round="10" @close="nicknameShow=false">
<view class="tanchu">
<view class="dp_title">请输入昵称</view>
<u--input v-model="userMes.nickname" placeholder="请输入昵称" border="surround" clearable></u--input>
<u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定"
@click="choseNickname(userMes.nickname)" style="margin-top: 50rpx;"></u-button>
<view @click="nicknameShow=false" class="dp_canBtn">取消</view>
</view>
</u-popup>
<!-- 年龄 -->
<u-popup :show="ageShow" :round="10" @close="ageShow=false">
<view class="tanchu">
<view class="dp_title">请输入年龄</view>
<u--input v-model="userMes.age" type="number" placeholder="请输入年龄" border="surround" clearable>
</u--input>
<u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定" @click="choseAge()"
style="margin-top: 50rpx;"></u-button>
<view @click="ageShow=false" class="dp_canBtn">
取消</view>
</view>
</u-popup>
<!-- 性别 -->
<u-popup :show="sexShow" :round="10" @close="sexShow=false">
<view class="tanchu">
<view class="dp_title">请选择性别</view>
<u-radio-group v-model="userMes.sex">
<view style="width: 100%;">
<view v-for="(item, index) in sexList" @click="choseSex(item.id)" class="dp_sex">
{{item.title}}
<u-radio :key="index" activeColor="#54a966" :name='item.id'
style="float: right;margin-top: 5rpx;" @change="choseSex(item.id)"></u-radio>
</view>
</view>
</u-radio-group>
<view @click="sexShow=false" class="dp_canBtn">取消</view>
</view>
</u-popup>
<!-- 密码 -->
<u-popup :show="passwordShow" :round="10" @close="cancelPass">
<view class="tanchu">
<view class="dp_title">请修改密码</view>
<u--input maxlength="8" v-model="userMiMa.password" placeholder="请输入新密码" :password="true"
border="surround" clearable @input="inputMethod(userMiMa.password)">
</u--input>
<view class="" style="font-size: 28rpx; color: #999;">
<p v-if="passNote != ''">{{passNote}}</p>
<p v-html="passStr" style="margin-top: 10rpx;"></p>
</view>
<u--input maxlength="8" v-model="userMiMa.Repassword" placeholder="请再确认密码" :password="true"
border="surround" clearable style="margin-top: 20rpx;"></u--input>
<u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定" @click="chosePassword()"
style="margin-top: 50rpx;"></u-button>
<view @click="cancelPass" class="dp_canBtn">取消</view>
</view>
</u-popup>
<!-- <view class="btn_box">
<button @click="chosePassword" class="active"> </button>
</view> -->
<music-play :playData="playData"></music-play>
</view> </view>
</template> </template>
<script> <script>
import musicPlay from '@/components/music.vue' import UserInfo from "edu-core/components/user-info/index.vue";
import $http from '@/config/requestConfig.js'; import $http from "@/config/requestConfig.js";
var clear; import { mapState } from "vuex";
import {
mapState export default {
} from 'vuex';
// 密码验证的正则
//1、密码为八位及以上并且字母数字特殊字符三项都包括
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g");
//2、密码为八位及以上并且字母、数字、特殊字符三项中有两项强度是中等
var mediumRegex = new RegExp(
"^(?=.{8,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[a-z])(?=.*\\W))|((?=.*[0-9])(?=.*\\W))|((?=.*[A-Z])(?=.*\\W))).*$",
"g");
var enoughRegex = new RegExp("(?=.{8,}).*", "g");
export default {
data() { data() {
return { return {
playData: {}, showSubmitInfoBlank: false,
userMes: { submitInfo: {},
quCode: '', dataList: [
phone: '', {
email: '', title: "昵称",
id: '', indexValue: "nickname",
age: '', type: "nickname",
sex: '',
nickname: '',
tel: '',
oldName: '', // 老的用户名
},
userMsage: {
quCode: '',
phonecode: '',
phone: '',
emailcode: '',
email: '',
id: '',
age: '',
sex: '',
nickname: '',
tel: '',
YNpass: '',
oldName: '', // 老的用户名
},
userMiMa: {
id: '',
password: '',
Repassword: '',
},
readonly: false,
phoneShow: false,
emailShow: false,
avatarShow: false,
nicknameShow: false,
ageShow: false,
sexShow: false,
passwordShow: false,
fileAvatar: [],
quCodeList: [], // 国家区域码
sexList: [{
title: '男',
id: 1,
}, },
{ {
title: '女', title: "手机号",
id: 0, indexValue: "tel",
} type: "tel",
},
{
title: "邮箱",
indexValue: "email",
type: "email",
},
{
title: "密码",
indexValue: "password",
type: "password",
},
{
title: "年龄",
indexValue: "age",
type: "age",
},
{
title: "性别",
indexValue: "sex",
type: "sex",
},
{
title: "身份",
indexValue: "socialIdentity",
type: "profile",
},
], ],
PhoneEmailNote: '获取验证码',
passNote: '',
passStr: '',
passwordOk: false, // 密码是否满足规则
}; };
}, },
//第一次加载 onLoad() {
onLoad(e) {
// 隐藏原生的tabbar
uni.hideTabBar(); uni.hideTabBar();
}, },
computed: { computed: {
...mapState(['userInfo']) ...mapState(["userInfo"]),
}, },
//页面显示
onShow() { onShow() {
// 隐藏原生的tabbar
uni.hideTabBar(); uni.hideTabBar();
this.getData();
this.getCountyCode()
}, },
components: { components: {
musicPlay UserInfo,
}, },
//方法
methods: { methods: {
// 获取 onShowSubmitInfo(info) {
getCountyCode() { this.submitInfo = info;
let that = this this.showSubmitInfoBlank = true;
// 获取国家区域编码
$http.request({
url: "book/baseArea/getAllBaseArea",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
}, },
}) closeManager() {
.then(res => { this.submitInfo = {};
// console.log(res,'区域码') this.showSubmitInfoBlank = false;
if (res.code == 0 && res.baseAreas.length > 0) {
that.quCodeList = res.baseAreas.map(item => {
let obj = {
'text': item.title + ' (+' + item.code + ')',
'value': item.code,
}
return obj
})
} else {
that.quCodeList = []
}
}).catch(e => {
console.log(e, 'e')
});
},
getData() {
let that = this
// 获取个人信息
if (this.userInfo.id != undefined) {
this.$http
.post('book/user/info/' + that.userInfo.id)
.then(res => {
that.userMes.id = res.user.id
that.userMes.age = res.user.age
that.userMes.sex = res.user.sex
that.userMes.nickname = res.user.nickname
that.userMes.tel = res.user.tel
that.userMes.avatar = res.user.avatar
that.userMes.oldName = that.userMes.nickname
that.userMes.id = res.user.id
that.userMsage.age = res.user.age
that.userMsage.email = res.user.email
that.userMsage.sex = res.user.sex
that.userMsage.nickname = res.user.nickname
that.userMsage.tel = res.user.tel
that.userMsage.avatar = res.user.avatar
that.userMsage.YNpass = res.user.password
that.userMiMa.id = res.user.id
});
}
},
cancelPass() {
this.passwordShow = false
this.userMiMa.password = ''
this.userMiMa.Repassword = ''
this.passNote = ''
this.passStr = ''
},
// 密码验证
inputMethod(value) {
this.passwordOk = false
// console.log('输入的值为:', value)
if (strongRegex.test(value)) {
//console.log('强密码-----',value)
this.passStr = "<span style='color:#18bc37'>密码强度很不错哦!</span>"
// this.passNote = '请至少使用大小写字母、数字、符号两种类型组合的密码长度为8位。'
this.passNote = ''
this.passwordOk = true
} else if (mediumRegex.test(value)) {
//console.log('中等密码-----',value)
this.passNote = '请至少使用大小写字母、数字、符号两种类型组合的密码长度为8位。'
this.passStr = "<span style='color:#2979ff'>密码强度中等!</span>"
this.passwordOk = true
} else if (enoughRegex.test(value)) {
//console.log('弱密码-----',value)
this.passStr = "<span style='color:#f3a73f'>密码强度太弱!</span>"
this.passNote = '请至少使用大小写字母、数字、符号两种类型组合的密码长度为8位。'
} else {
this.passwordOk = false
this.passNote = '请至少使用大小写字母、数字、符号两种类型组合的密码长度为8位。'
this.passStr = ""
//console.log('密码-----',value)
}
},
// 清除验证码
OpenClear() {
clearInterval(clear)
this.PhoneEmailNote = '获取验证码';
this.readonly = false;
},
// 获取验证码
emPHCode() {
clear && clearInterval(clear);
this.readonly = true
this.PhoneEmailNote = '60S';
var s = 60;
clear = setInterval(() => {
s--;
this.PhoneEmailNote = s + 'S';
if (s <= 0) {
clearInterval(clear);
this.PhoneEmailNote = '获取验证码';
this.readonly = false;
}
}, 1000);
},
// 发送验证码
onSetCode(e) {
if (this.readonly) {
return;
}
if (e == 'phone') {
if (this.userMes.phone == '') {
uni.showToast({
title: '请输入手机号',
icon: 'none'
});
return;
}
if (this.userMes.quCode == '' || this.userMes.quCode == 86) {
if (!this.$base.phoneRegular.test(this.userMes.phone)) {
uni.showToast({
title: '手机格式不正确',
icon: 'none'
});
return;
}
}
this.$http
.get('book/user/sms/sendcode', {
phone: this.userMes.phone,
areaCode: this.userMes.quCode,
type: 2000
})
.then(res => {
uni.showToast({
title: '验证码发送成功',
icon: 'none'
});
this.emPHCode();
});
}
if (e == 'email') {
if (!this.userMes.email) {
uni.showToast({
title: '请输入邮箱',
icon: 'none'
});
return;
}
if (!this.$base.mailRegular.test(this.userMes.email)) {
uni.showToast({
title: '邮箱格式不正确',
icon: 'none'
});
return;
}
this.$http
.get('book/user/getMailCaptcha', {
email: this.userMes.email
})
.then(res => {
uni.showToast({
title: '验证码发送成功',
icon: 'none'
});
this.emPHCode();
});
}
},
// 手机
chosePhone(e) {
this.userMes.code = this.userMes.phonecode
if (this.userMes.phone == '') {
uni.showToast({
title: '请输入手机号',
icon: 'none'
});
return;
}
if (this.userMes.code == '' || this.userMes.code == null) {
uni.showToast({
title: '请输入验证码',
icon: 'none'
});
return;
}
let that = this
$http.request({
url: "book/user/updateUserTel",
method: "POST",
data: this.userMes,
header: {
'Content-Type': 'application/json'
},
}).then(function(res) {
if (res.code == 0) {
that.getData();
that.phoneShow = false
uni.showToast({
title: "绑定手机号成功"
});
}
}).catch(function(error) {
console.log(error);
});
},
// 邮箱
choseEmail(e) {
this.userMes.code = this.userMes.emailcode
if (this.userMes.email == '') {
uni.showToast({
title: '请输入邮箱',
icon: 'none'
});
return;
}
if (this.userMes.code == '' || this.userMes.code == null) {
uni.showToast({
title: '请输入验证码',
icon: 'none'
});
return;
}
let that = this
$http.request({
url: "book/user/updateUserEmail",
method: "POST",
data: this.userMes,
header: {
'Content-Type': 'application/json'
},
}).then(function(res) {
if (res.code == 0) {
that.getData();
that.emailShow = false
uni.showToast({
title: "绑定邮箱成功"
});
}
}).catch(function(error) {
console.log(error);
});
},
// 头像
choseAvatar(e) {
let that = this
if (that.fileAvatar.length == 0) {
uni.showToast({
title: "请选择图片",
icon: 'none'
});
return
}
that.userMes.avatar = that.fileAvatar[0].url
that.choseData()
that.avatarShow = false
that.fileAvatar.splice(0, 1)
},
// 年龄
choseAge(e) {
let that = this
if (that.userMes.age <= 0) {
uni.showToast({
title: "年龄不能小于0",
icon: 'none'
});
return
}
that.choseData()
that.ageShow = false
},
// 昵称
choseNickname(e) {
let that = this
if (e && e != '') {
that.choseData()
that.nicknameShow = false
} else {
that.userMes.nickname = that.userMes.oldName
console.log(that.userMes.nickname)
uni.showToast({
title: '昵称不可为空',
icon: 'none'
})
}
},
// 性别
choseSex(e) {
let that = this
that.userMes.sex = e
that.choseData()
that.sexShow = false
},
// 修改密码
chosePassword() {
if (!this.passwordOk) {
console.log('不满足密码格式', this.passNote)
uni.showToast({
title: this.passNote,
icon: 'none'
})
return
}
let that = this
if (that.userMiMa.Repassword == '' || that.userMiMa.password == '') {
uni.showToast({
icon: "none",
title: "请输入密码!"
});
return
}
if (that.userMiMa.Repassword != that.userMiMa.password) {
uni.showToast({
icon: "none",
title: "两次密码输入不一致!"
});
return
}
$http.request({
url: "book/user/updateUserPassword",
method: "POST",
data: that.userMiMa,
header: {
'Content-Type': 'application/json'
},
}).then(function(res) {
if (res.code == 0) {
uni.showToast({
title: "修改成功"
});
that.passwordShow = false
}
}).catch(function(error) {
console.log(error);
});
},
// 修改个人资料
choseData() {
let that = this
$http.request({
url: "book/user/update",
method: "POST",
data: that.userMes,
header: {
'Content-Type': 'application/json'
},
}).then(function(res) {
if (res.code == 0) {
that.getData();
// that.$forceUpdate()
uni.showToast({
title: "修改成功"
});
}
}).catch(function(error) {
console.log(error);
});
},
// 头像上传
afterRead(e) {
let that = this
uni.uploadFile({
url: this.$baseUrl + 'oss/fileoss',
filePath: e.file[0].url,
name: 'file',
formData: {},
success: (res) => {
that.fileAvatar.push({
url: JSON.parse(res.data).url
})
}
});
},
// 删除图片
deletePic() {
let that = this
that.fileAvatar.splice(0, 1)
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/style/mixin.scss'; .container{
padding-top: 5px;
.btn_box {
margin-top: 40rpx;
padding: 10px;
button {
font-size: 32rpx;
background-color: #e5e5e5;
color: #fff;
height: 80rpx;
line-height: 80rpx;
border-radius: 50rpx;
&.active {
@include theme('btn_bg') color: #fff;
}
}
}
.tabulate {
.per_list {
font-size: 30rpx;
background-color: #fff;
padding: 0;
align-items: center;
position: relative;
border-top: 1px solid #e5e5e5;
width: 100%;
overflow: auto;
text.biaoti {
color: #333;
display: inline-block;
margin: 25rpx 0 25rpx 40rpx;
}
text.neirong {
color: #888;
font-weight: normal;
float: right;
margin: 25rpx 80rpx 0 0;
display: block;
}
text.marPer {
color: #fff;
font-weight: normal;
float: right;
margin: 25rpx 0 0 0;
display: block;
border-radius: 10rpx;
background-color: #eee;
padding: 2rpx 10rpx;
}
}
.per_list_arrow {
font-size: 30rpx;
background-color: #fff;
padding: 0;
align-items: center;
position: relative;
border-top: 1px solid #e5e5e5;
width: 100%;
overflow: auto;
&:active {
background-color: #f5f5f5;
}
&::after {
content: '';
position: absolute;
right: 20upx;
top: 50%;
transform: translateY(-50%);
width: 40upx;
height: 40upx;
background-image: url('../../static/icon/icon_right.png');
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
}
.per_mes_img {
width: 100rpx;
height: 100rpx;
background-color: #fff;
border-radius: 120rpx;
margin: 10rpx 0;
}
}
}
.tanchu {
padding: 60rpx 50rpx 80rpx 50rpx;
.dp_title {
font-size: 32rpx;
margin-bottom: 50rpx;
color: #555;
text-align: center;
font-weight: bold;
}
.dp_sex {
font-size: 30rpx;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
border-bottom: 1px solid #ededed;
image {
width: 40rpx;
height: 40rpx;
display: inline-block;
margin-right: 20rpx;
vertical-align: bottom;
}
}
.dp_canBtn {
text-align: center;
font-size: 28rpx;
margin-top: 25rpx;
color: #888;
}
.emPHCode {
height: 80rpx;
width: 200rpx;
background-color: #f8f9fb;
font-size: 28rpx;
padding: 0 14rpx;
color: #54a966;
line-height: 80rpx;
margin: 20rpx 0 0 20rpx;
display: inline-block;
}
.quhao {
height: 60rpx;
width: 240rpx;
margin: 1rpx 15rpx 0 0;
.quhaoSel {
/deep/.uni-select {
font-size: 24rpx;
}
/deep/.uni-select__selector-item {
font-size: 24rpx;
}
/deep/.uni-stat__select {
height: 60rpx;
}
}
}
} }
</style> </style>

Binary file not shown.