Просмотр исходного кода

跳转本地生活小程序界面连接改为接口动态获取

xueyihao 4 месяцев назад
Родитель
Сommit
ac8c792cc8
3 измененных файлов с 7 добавлено и 5 удалено
  1. 5 2
      src/components/webviewPoint.vue
  2. 1 2
      src/pages/order/order.vue
  3. 1 1
      src/points/order/orderList.vue

+ 5 - 2
src/components/webviewPoint.vue

@@ -38,13 +38,16 @@ export default {
     }
   },
   methods: {
-    getRow(activityId){
+    getRow(res){
+      let activityUrl = res?.activityUrl.split('/#/')[1] || '';
+      let activityId = res?.activityId;
       let currentPlatform = 'gyy-aB4cD6eF8gH0iJ2kL4';
       let currentUser = uni.getStorageSync('userId');
-      let url = '/packageF/pages/activity/lottery/turntable?activityId='+ activityId + '&currentPlatform='+currentPlatform+'&currentUser='+currentUser;
+      let url = `/${activityUrl}?activityId=${activityId}&currentPlatform=${currentPlatform}&currentUser=${currentUser}`;
       this.initLaunchButton(url)
     },
     async initLaunchButton(url) {
+      console.log(url)
       try {
         await handleServiceAdjustMiniProgram();
         this.show = true;

+ 1 - 2
src/pages/order/order.vue

@@ -137,9 +137,8 @@ export default {
 	onShow() {
     var _this = this;
     getIsLottery({types:[1,3]}).then(res=>{
-      console.log(res.data.data)
       if(res.data.data?.isLottery === 1){
-        _this.$refs.webviewRef?.getRow(res.data.data?.activityId);
+        _this.$refs.webviewRef?.getRow(res.data.data);
       }
     })
 		this.getStatus()

+ 1 - 1
src/points/order/orderList.vue

@@ -23,7 +23,7 @@ export default {
   mounted(){
     getIsLottery({types:[2]}).then(res=>{
       if(res.data.data?.isLottery === 1){
-        this.$refs.webviewRef?.getRow(res.data.data.activityId);
+        this.$refs.webviewRef?.getRow(res.data.data);
       }
     })
   },