瀏覽代碼

我的页面调整;我的订单接口联调

htc 2 天之前
父節點
當前提交
a80614476c
共有 7 個文件被更改,包括 77 次插入52 次删除
  1. 1 1
      manifest.json
  2. 2 0
      pages/home.vue
  3. 5 2
      pages/login.vue
  4. 7 7
      pages/my.vue
  5. 3 1
      pages/registerInfo.vue
  6. 58 39
      pagesMy/order.vue
  7. 1 2
      pagesPublish/rechargeCenter.vue

+ 1 - 1
manifest.json

@@ -102,7 +102,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wxb0ecfcf0c3e50402",
+        "appid" : "wxe6afb089695f90e7",
         "setting" : {
             "urlCheck" : false,
             "es6" : false,

+ 2 - 0
pages/home.vue

@@ -147,6 +147,8 @@
 				this.getWjList();
 				this.getReportList();
 			}
+			
+			if(uni.getStorageSync('newUser')) this.newUserFreeShow = true;
 		},
 		methods:{
 			toTurn(url){

+ 5 - 2
pages/login.vue

@@ -100,8 +100,11 @@
 							channelType:that.channelType
 						},false).then(res=>{
 							if(res.data.code===0){
-								if(res.data.data.isRegister==1) that.loginSuccessFn(res);
-								else{
+								if(res.data.data.isRegister==1){
+									if(uni.getStorageSync('newUser')) uni.removeStorageSync('newUser')
+									that.loginSuccessFn(res);
+								} else{
+									uni.setStorageSync('newUser',true)
 									uni.navigateTo({
 										url:'/pages/registerInfo?params='+encodeURIComponent(JSON.stringify({
 											info:{

+ 7 - 7
pages/my.vue

@@ -6,11 +6,11 @@
 			<view class="top adfacjb">
 				<view class="top-left adfac">
 					<view class="top-left-img">
-						<image :src="userInfo.avatar"></image>
+						<image :src="userInfo.headUrl||(imgBase+'avatar.png')"></image>
 					</view>
 					<view class="top-left-info">
-						<view class="top-left-info-name">{{userInfo.name||'未登录'}}</view>
-						<view class="top-left-info-tip" v-if="!userInfo.name">点击立即登录</view>
+						<view class="top-left-info-name">{{userInfo.realName||'未登录'}}</view>
+						<view class="top-left-info-tip" v-if="!userInfo.id">点击立即登录</view>
 						<view class="top-left-info-version" v-else>{{'基础版'}}</view>
 					</view>
 				</view>
@@ -33,8 +33,8 @@
 				</view>
 			</view>
 			<view class="preill adfacjb">
-				<view class="preill-left">{{userInfo.name?'已激活,深入了解支撑高价值团队的关键因素':'尚未激活问卷,无法开始PREILL评估'}}</view>
-				<view class="preill-right" @click="handleActiveDetail">{{userInfo.name?'查看详情':'立即激活'}}</view>
+				<view class="preill-left">深入了解支撑高价值团队的关键因素</view>
+				<view class="preill-right" @click="handleActiveDetail">立即购买</view>
 			</view>
 			<view class="menu">
 				<view class="menu-item adfacjb" v-for="(item,index) in menuList" :key="index" @click="handleTurn(item.path)">
@@ -89,8 +89,8 @@
 				]
 			}
 		},
-		onLoad() {
-			
+		onLoad(options) {
+			if(uni.getStorageSync('userInfo')) this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
 		},
 		methods:{
 			handleTurn(url){

+ 3 - 1
pages/registerInfo.vue

@@ -30,6 +30,7 @@
 				info:null,
 				user:null,
 				dto:{
+					userId:'',
 					mobile:'',
 					realName:'',
 					email:''
@@ -40,6 +41,7 @@
 			let params = JSON.parse(decodeURIComponent(options.params));
 			this.info = params.info;
 			this.user = params.user;
+			this.dto.userId = this.info.userId||'';
 			this.dto.mobile = this.info.mobile||'';
 		},
 		methods:{
@@ -55,7 +57,7 @@
 			},
 			postRegisterRecord(){
 				this.$api.post('/core/register/record',{
-					channelType:this.info.channelType||'',
+					channelType:this.info.channelType||'common',
 					referrerId:this.info.referrerId||'',
 					teamQuestionnaireId:this.info.teamQuestionnaireId||'',
 					userId:this.info.userId||''

+ 58 - 39
pagesMy/order.vue

@@ -3,26 +3,26 @@
 		<cus-header title='我的订单'></cus-header>
 		<view class="tab adfac">
 			<view class="tab-pre" :class="{'active':tindex===index}" @click="changeTab(item,index)"
-				v-for="(item,index) in statusList" :key="index">{{item}}</view>
+				v-for="(item,index) in statusList" :key="index">{{item.name}}</view>
 		</view>
 		<view class="list">
 			<view class="list-pre" v-for="(item,index) in list" :key="index" @click.prevent="handleDetail(item)">
 				<view class="list-pre-top adfacjb">
-					<view class="list-pre-top-no">订单号:{{item.no}}</view>
-					<view class="list-pre-top-status" :class="statusColor[item.status]">{{statusCfg[item.status]}}</view>
+					<view class="list-pre-top-no">订单号:{{item.orderNo}}</view>
+					<view class="list-pre-top-status" :class="statusColor[item.orderStatus]">{{statusCfg[item.orderStatus]}}</view>
 				</view>
 				<view class="list-pre-info adf">
 					<view class="list-pre-info-left adfac">
 						<image class="list-pre-info-left-img" :src="imgBase+'order_img.png'"></image>
 						<view class="list-pre-info-left-texts">
-							<view class="list-pre-info-left-texts-num">{{typeCfg[item.type]}}{{item.sum}}次,剩余{{item.next}}次可用</view>
-							<view class="list-pre-info-left-texts-date">有效期至 {{item.date}}</view>
+							<view class="list-pre-info-left-texts-num">{{typeCfg[item.type]}}{{item.totalFrequency}}次,剩余{{item.useFrequency}}次可用</view>
+							<view class="list-pre-info-left-texts-date">有效期至 {{item.expirationTime}}</view>
 						</view>
 					</view>
-					<view class="list-pre-info-right">¥{{item.price.toFixed(2)}}</view>
+					<view class="list-pre-info-right">¥{{(+item.totalAmount||0).toFixed(2)}}</view>
 				</view>
 				<view class="list-pre-btns adf">
-					<view class="list-pre-btns-pre cancel" v-if="item.status==0" @click.stop="orderCancel">取消订单</view>
+					<view class="list-pre-btns-pre cancel" v-if="item.orderStatus==0" @click.stop="orderCancel">取消订单</view>
 					<view class="list-pre-btns-pre" @click.stop="buyAgain">再次购买</view>
 				</view>
 			</view>
@@ -35,55 +35,71 @@
 		data(){
 			return {
 				tindex:0,
-				statusList:['全部','已支付','待支付','已取消'],
+				statusList:[
+					{state:'',name:'全部'},
+					{state:'1',name:'已支付'},
+					{state:'0',name:'待支付'},
+					{state:'-2',name:'已取消'}
+				],
 				statusCfg:{
+					'-3':'已退款',
+					'-2':'已取消',
+					'-1':'已失效',
 					0:'待支付',
 					1:'已支付',
-					2:'已取消'
+					2:'已完成'
 				},
 				statusColor:{
 					0:'dzf',
 					1:'yzf',
-					2:'yqx'
+					2:'yzf',
+					'-2':'yqx'
 				},
 				typeCfg:{
 					1:'基础版',
 					2:'专业版'
 				},
-				list:[
-					{
-						no:'20229485872902',
-						status:1,
-						type:1,
-						sum:1,
-						next:1,
-						price:99,
-						date:'2025-11-11'
-					},
-					{
-						no:'20229485872902',
-						status:0,
-						type:2,
-						sum:5,
-						next:4,
-						price:199,
-						date:'2025-11-11'
-					},
-					{
-						no:'20229485872902',
-						status:2,
-						type:2,
-						sum:10,
-						next:0,
-						price:799,
-						date:'2025-11-11'
-					}
-				]
+				query:{
+					page:1,
+					limit:10,
+					orderStatus:'',
+					userId:''
+				},
+				isOver:false,
+				list:[]
+			}
+		},
+		onReachBottom() {
+			if(this.isOver) return
+			this.getList()
+		},
+		onLoad(options) {
+			try{
+				this.query.userId = JSON.parse(uni.getStorageSync('userInfo')).id;
+				this.getList()
+			}catch(e){
+				this.query.userId = '';
 			}
 		},
 		methods:{
+			init(){
+				this.query.page = 1;
+				this.isOver = false;
+				this.list = [];
+				this.getList()
+			},
+			getList(){
+				this.$api.get('/que/order/page',this.query).then(({data:res})=>{
+					if(res.code!==0) return this.$showToast(res.msg)
+					this.list = [...this.list,...res.data.list]
+					if(this.list.length < res.data.total) this.query.page++
+					else this.isOver = true
+				})
+			},
 			changeTab(item,index){
 				this.tindex = index;
+				this.query.orderStatus = item.state;
+				this.init()
 			},
 			handleDetail(item){
 				uni.navigateTo({
@@ -93,6 +109,9 @@
 			orderCancel(){
 			},
 			buyAgain(){
+				uni.navigateTo({
+					url:'/pagesPublish/rechargeCenter'
+				})
 			},
 		}
 	}

+ 1 - 2
pagesPublish/rechargeCenter.vue

@@ -10,8 +10,7 @@
 					<view class="text">{{'龙傲天'}}</view>
 					<view class="version">{{'基础版'}}</view>
 				</view>
-				<!-- <view class="info-right-tip">{{'尚未激活问卷,无法开始PREILL评估'}}</view> -->
-				<view class="info-right-tip">剩余次数:基础版{{5}}次,专业版{{0}}次</view>
+				<view class="info-right-tip">可用次数:基础版{{0}}次,专业版{{0}}次</view>
 			</view>
 		</view>
 		<view class="box adffc">