Ver código fonte

文件结果及跳转调整

wangxy 1 mês atrás
pai
commit
93b50d6022

+ 1 - 1
api/chanpinZiRanPinDu.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request'
 
-export function getChanpin3DengjiSave(data = {}) {
+export function getChanpin4DengjiSave(data = {}) {
     return request({
         'url': '/app/pindu/chanpin/dengji/save',
         headers: {

+ 1 - 1
pages.json

@@ -72,7 +72,7 @@
 			}
 		},
 		{
-			"path": "pages/chanpinXuanze/cp4/banben",
+			"path": "pages/chanpinXuanze/cp3/banben",
 			"style": {
 				"navigationStyle": "custom"
 			}

+ 2 - 2
pages/chanpinShop/components/yingyuList.vue

@@ -13,8 +13,8 @@
 </template>
 
 <script setup>
-import cardVue from '../cp3/card.vue';
-import cardVue2 from '../cp4/card.vue';
+import cardVue from '../cp4/card.vue';
+import cardVue2 from '../cp3/card.vue';
 
 	const props = defineProps({
 		list: {

+ 1 - 1
pages/chanpinShop/cp3/card.vue

@@ -24,7 +24,7 @@ const props = defineProps({
 	// 选择产品等级
 function handleClick() {
 	uni.navigateTo({
-		url: '/pages/chanpinShop/cp3/intro'
+		url: '/pages/chanpinShop/cp4/intro'
 	})
 }
 

+ 5 - 2
pages/chanpinShop/cp3/dingdan.vue

@@ -57,7 +57,7 @@
 							}"></icon>
 							<text>{{item.name}}</text>
 						</view>
-						<radio :value="item.value" :checked="index === current" class="qrdd-radio-item" />
+						<radio :value="item.value" :checked="index === current" class="qrdd-radio-item"/>
 					</label>
 				</radio-group>
 			</template>
@@ -93,6 +93,9 @@
 	import * as shopHttp from "@/api/shop.js"
 	import kaiTongFongShiVue from "../components/kaiTongFongShi.vue";
 	import {
+		getAppCp4Buy
+	} from "@/api/shop";
+	import {
 		usePay
 	} from "../usePay.js";
 	import {
@@ -230,7 +233,7 @@
 	}
 
 	function initPage() {
-		shopHttp.getAppCp3Buy().then(res => {
+		shopHttp.getAppCp4Buy().then(res => {
 			Object.assign(data, res.data)
 
 			activeTaocan.value = res.data.taocanList[0]

+ 2 - 2
pages/chanpinShop/cp3/intro.vue

@@ -48,7 +48,7 @@
 	})
 
 	function initPage() {
-		shopHttp.getAppCp3Info().then(res => {
+		shopHttp.getAppCp4Info().then(res => {
 			imageUrl.value = res.data.image;
 		})
 	}
@@ -66,7 +66,7 @@
   }
 	function handleStudy() {
 		uni.navigateTo({
-			url: '/pages/chanpinShop/cp3/dingdan'
+			url: '/pages/chanpinShop/cp4/dingdan'
 		})
 	}
 	

+ 1 - 1
pages/chanpinShop/cp4/card.vue

@@ -24,7 +24,7 @@ const props = defineProps({
 	// 选择产品等级
 function handleClick() {
 	uni.navigateTo({
-		url: '/pages/chanpinShop/cp4/intro'
+		url: '/pages/chanpinShop/cp3/intro'
 	})
 }
 

+ 2 - 5
pages/chanpinShop/cp4/dingdan.vue

@@ -57,7 +57,7 @@
 							}"></icon>
 							<text>{{item.name}}</text>
 						</view>
-						<radio :value="item.value" :checked="index === current" class="qrdd-radio-item"/>
+						<radio :value="item.value" :checked="index === current" class="qrdd-radio-item" />
 					</label>
 				</radio-group>
 			</template>
@@ -93,9 +93,6 @@
 	import * as shopHttp from "@/api/shop.js"
 	import kaiTongFongShiVue from "../components/kaiTongFongShi.vue";
 	import {
-		getAppCp4Buy
-	} from "@/api/shop";
-	import {
 		usePay
 	} from "../usePay.js";
 	import {
@@ -233,7 +230,7 @@
 	}
 
 	function initPage() {
-		shopHttp.getAppCp4Buy().then(res => {
+		shopHttp.getAppCp3Buy().then(res => {
 			Object.assign(data, res.data)
 
 			activeTaocan.value = res.data.taocanList[0]

+ 2 - 2
pages/chanpinShop/cp4/intro.vue

@@ -48,7 +48,7 @@
 	})
 
 	function initPage() {
-		shopHttp.getAppCp4Info().then(res => {
+		shopHttp.getAppCp3Info().then(res => {
 			imageUrl.value = res.data.image;
 		})
 	}
@@ -66,7 +66,7 @@
   }
 	function handleStudy() {
 		uni.navigateTo({
-			url: '/pages/chanpinShop/cp4/dingdan'
+			url: '/pages/chanpinShop/cp3/dingdan'
 		})
 	}
 	

+ 4 - 3
pages/chanpinShop/index.vue

@@ -99,9 +99,10 @@
 	function getPageData() {
 		shopHttp.getAppShopIndex().then(res => {
 			const result = getFormatData(res.data);
-			data.shuxueList = result.shuxue;
-			data.yingyuList = result.yingyu;
-			data.yuwenList = result.yuwen;
+      // 追加排序,以产品id 小在前
+			data.shuxueList = result.shuxue.sort((a,b) => a.value.chanpinId - b.value.chanpinId);
+			data.yingyuList = result.yingyu.sort((a,b) => a.value.chanpinId - b.value.chanpinId);
+			data.yuwenList = result.yuwen.sort((a,b) => a.value.chanpinId - b.value.chanpinId);
 		})
 	}
 

+ 4 - 4
pages/chanpinXuanze/components/yingyuList.vue

@@ -1,8 +1,8 @@
 <template>
 	<view class="sx-card-list" v-if="list.length">
     <template  v-for="{chanpin,value:item} in list" :item="item">
-     <cardVue v-if="chanpin == 'ziranpindu'" :item="item" :key="item.chanpinId"></cardVue>
-     <cp4 v-if="chanpin == 'chaojidanci'" :item="item" :key="item.chanpinId"></cp4>
+      <cardVue v-if="chanpin == 'ziranpindu'" :item="item" :key="item.chanpinId"></cardVue>
+      <cp3 v-if="chanpin == 'chaojidanci'" :item="item" :key="item.chanpinId"></cp3>
     </template>
     <view class="ezy-no-more">没有更多</view>
 	</view>
@@ -13,8 +13,8 @@
 </template>
 
 <script setup>
-  import cardVue from '../cp3/card.vue';
-  import cp4 from "../cp4/card.vue";
+  import cp3 from "../cp3/card.vue";
+  import cardVue from '../cp4/card.vue';
 
 	const props = defineProps({
 		list: {

+ 0 - 0
pages/chanpinXuanze/cp4/banben.vue → pages/chanpinXuanze/cp3/banben.vue


+ 7 - 18
pages/chanpinXuanze/cp3/card.vue

@@ -15,41 +15,30 @@
     <view class="card-body-box">
       <view class="body-title">请选择学习等级</view>
       <view class="dj-item-row">
-        <ezyActiveVue v-for="cItem in item.levelList" class="ezy-btn-active dj-item"
-                      @aclick="handleSelect(cItem)" :class="{active: cItem.active}">{{cItem.levelName}}</ezyActiveVue>
+        <ezyActiveVue v-for="cItem in item.levelList" class="ezy-btn-active dj-item" @aclick="handleSelect(cItem)" :class="{active: cItem.active}">{{cItem.levelName}}</ezyActiveVue>
       </view>
     </view>
   </view>
 </template>
 
 <script setup>
-import * as pinduHttp from "@/api/chanpinZiRanPinDu.js"
 import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
-import cacheManager from "@/utils/cacheManager.js";
 const porps = defineProps({
   item: {
     type: Object
   }
 })
-// 选择产品等级
+	// 选择产品等级
 function handleSelect(item) {
   porps.item.levelList.forEach(citem => {citem.active = false; if (item.dengjiId == citem.dengjiId) {citem.active = true}})
-  const opt = {
-    dengjiId: item.dengjiId,
-  }
-  pinduHttp.getChanpin3DengjiSave(opt).then(res => {
-    if (!res.data) {
-      return;
-    }
-    cacheManager.get('contentInfo') && cacheManager.remove('contentInfo');
-    // 跳转
-    uni.switchTab({
-      url: "/pages/chanpinneirong/index"
-    })
+
+  uni.navigateTo({
+    url: `/pages/chanpinXuanze/cp3/banben?dengjiId=${item.dengjiId}`
   })
 }
+
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 18 - 7
pages/chanpinXuanze/cp4/card.vue

@@ -15,30 +15,41 @@
     <view class="card-body-box">
       <view class="body-title">请选择学习等级</view>
       <view class="dj-item-row">
-        <ezyActiveVue v-for="cItem in item.levelList" class="ezy-btn-active dj-item" @aclick="handleSelect(cItem)" :class="{active: cItem.active}">{{cItem.levelName}}</ezyActiveVue>
+        <ezyActiveVue v-for="cItem in item.levelList" class="ezy-btn-active dj-item"
+                      @aclick="handleSelect(cItem)" :class="{active: cItem.active}">{{cItem.levelName}}</ezyActiveVue>
       </view>
     </view>
   </view>
 </template>
 
 <script setup>
+import * as pinduHttp from "@/api/chanpinZiRanPinDu.js"
 import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
+import cacheManager from "@/utils/cacheManager.js";
 const porps = defineProps({
   item: {
     type: Object
   }
 })
-	// 选择产品等级
+// 选择产品等级
 function handleSelect(item) {
   porps.item.levelList.forEach(citem => {citem.active = false; if (item.dengjiId == citem.dengjiId) {citem.active = true}})
-
-  uni.navigateTo({
-    url: `/pages/chanpinXuanze/cp4/banben?dengjiId=${item.dengjiId}`
+  const opt = {
+    dengjiId: item.dengjiId,
+  }
+  pinduHttp.getChanpin4DengjiSave(opt).then(res => {
+    if (!res.data) {
+      return;
+    }
+    cacheManager.get('contentInfo') && cacheManager.remove('contentInfo');
+    // 跳转
+    uni.switchTab({
+      url: "/pages/chanpinneirong/index"
+    })
   })
 }
-
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 4 - 3
pages/chanpinXuanze/index.vue

@@ -102,9 +102,10 @@
 	function getShuxueList() {
 		shuxueHttp.getChanpinTongyongIndex().then(res => {
 			const result = getFormatData(res.data);
-			data.shuxueList = result.shuxue;
-			data.yingyuList = result.yingyu;
-			data.yuwenList = result.yuwen;
+      // 追加排序,以产品id 小在前
+			data.shuxueList = result.shuxue.sort((a,b) => a.value.chanpinId - b.value.chanpinId);
+			data.yingyuList = result.yingyu.sort((a,b) => a.value.chanpinId - b.value.chanpinId);
+			data.yuwenList = result.yuwen.sort((a,b) => a.value.chanpinId - b.value.chanpinId);
 			
 			if (!data.shuxueList.length && !data.yingyuList.length && !data.yuwenList.length) {
 				// 并无学习数据时,清理时间缓存

+ 4 - 3
pages/chanpinZiliao/index.vue

@@ -60,9 +60,10 @@ function handleSelectChanpin(item) {
 function getZiliaoList() {
   ziliaoIndex({}).then(res => {
     const result = getFormatData(res.data);
-    data.shuxueList = result.shuxue;
-    data.yingyuList = result.yingyu;
-    data.yingyuList = result.yuwen;
+    // 追加排序,以产品id 小在前
+    data.shuxueList = result.shuxue.sort((a,b) => a.value.chanpinId - b.value.chanpinId);
+    data.yingyuList = result.yingyu.sort((a,b) => a.value.chanpinId - b.value.chanpinId);
+    data.yingyuList = result.yuwen.sort((a,b) => a.value.chanpinId - b.value.chanpinId);
 	
 	if (!data.shuxueList.length && !data.yingyuList.length && !data.yingyuList.length) {
 		// 并无数据时,清理时间缓存

+ 1 - 1
pages/chanpinneirong/chanpin3.vue

@@ -131,7 +131,7 @@
 			handleConfirmBtn() {
 				// 加锁视频需要购买
 				uni.navigateTo({
-					url: "/pages/chanpinShop/cp4/dingdan"
+					url: "/pages/chanpinShop/cp3/dingdan"
 				})
 			},
 			initData(banbenId) {

+ 1 - 1
pages/chanpinneirong/chanpin4.vue

@@ -144,7 +144,7 @@
 			handleConfirmBtn() {
 				// 加锁视频需要购买
 				uni.navigateTo({
-					url: "/pages/chanpinShop/cp3/dingdan"
+					url: "/pages/chanpinShop/cp4/dingdan"
 				})
 			},
 			initData(dengjiId) {

+ 1 - 1
pages/chaojidanci/wordList/wordList.vue

@@ -361,7 +361,7 @@ function toWord(data) {
 // 去支付
 function goPayPage() {
   uni.navigateTo({
-    url: "/pages/chanpinShop/cp4/dingdan"
+    url: "/pages/chanpinShop/cp3/dingdan"
   });
 }
 </script>