Pārlūkot izejas kodu

fix:修复群里所说的问题;

tengpanxu 5 mēneši atpakaļ
vecāks
revīzija
a3ad75fb3c

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 554 - 161
package-lock.json


BIN
src/assets/img/me/congzhi.png


+ 62 - 62
src/views/Forestage/Order/index.vue

@@ -27,78 +27,78 @@
 </template>
 
 <script>
-import {orderlist} from '@/api/order.js';
-import tools from '@/utils/tools.js';
+import { ordercreat, orderlist } from '@/api/order.js'
+import tools from '@/utils/tools.js'
 import OrderSett from '@/views/Forestage/Tourism/order-sett.vue'
 export default {
   name: 'Order',
-  data(){
-			return{
-				page:1,
-				list:[],
-        isAJAX: false,
-				total:0,
-        lang:'en',
-        orderId: ``
-			}
-		},
-  mounted() {
-    this.lang =tools.getLang()
+  components: { OrderSett },
+  data () {
+    return {
+      page: 1,
+      list: [],
+      isAJAX: false,
+      total: 0,
+      lang: 'en',
+      orderId: ''
+    }
+  },
+  mounted () {
+    this.lang = tools.getLang()
 
     setInterval(() => {
       this.lang = tools.getLang()
-
-    }, 500); // 每隔1秒检查一次
-    this.getList();
+    }, 500) // 每隔1秒检查一次
+    this.getList()
   },
   methods: {
-    getList(){
-			orderlist({page:this.page}).then((res)=>{
-				if(res.code == 1){
-					this.list = res.data.list;
-					this.total = res.data.total
-				}
-			})
-		},
-    upPage(){
-			if(this.page == 1){
-				return tools.error(this.$t('yddyy'))
-			}else{
-				this.page -= 1;
-				this.getList();
-			}
-		},
-		downPage(){
-			let flag = (this.page*1)*20 < (this.total * 1);
-			if(!flag){
-				return tools.error(this.$t('mygdsj'))
-			}else{
-				this.page += 1;
-				this.getList();
-			}
-		},
+    getList () {
+      orderlist({ page: this.page }).then((res) => {
+        if (res.code == 1) {
+          this.list = res.data.list
+          this.total = res.data.total
+        }
+      })
+    },
+    upPage () {
+      if (this.page == 1) {
+        return tools.error(this.$t('yddyy'))
+      } else {
+        this.page -= 1
+        this.getList()
+      }
+    },
+    downPage () {
+      const flag = (this.page * 1) * 20 < (this.total * 1)
+      if (!flag) {
+        return tools.error(this.$t('mygdsj'))
+      } else {
+        this.page += 1
+        this.getList()
+      }
+    },
 
-    goToPay() {
-      let  token= localStorage.getItem('userToken')
-        if (token){
-          if(this.isAJAX){
-            return
+    goToPay (item) {
+      const token = localStorage.getItem('userToken')
+      if (token) {
+        if (this.isAJAX) {
+          return
+        }
+        this.isAJAX = true
+        ordercreat({
+          goods_id: item.id
+        }).then((res) => {
+          if (res.code == 1) {
+            this.isAJAX = false
+            // tools.success(res.msg)
+            this.orderId = res.data.order_id
+            this.$refs.orderSett.setOpen(true)
+          } else {
+            this.isAJAX = false
+            tools.error(res.msg)
           }
-          this.isAJAX = true;
-          ordercreat({
-            goods_id: item.id
-          }).then((res) => {
-            if(res.code == 1){
-              this.isAJAX = false;
-              // tools.success(res.msg)
-              this.orderId = res.data.order_id
-              this.$refs.orderSett.setOpen(true)
-            }else{
-              this.isAJAX = false;
-              tools.error(res.msg)
-            }
-          })
-        } else {
+        })
+      } else {
         this.$router.push({ path: '/login' })
       }
     }

+ 24 - 19
src/views/Forestage/Tourism/balance-tip.vue

@@ -15,7 +15,7 @@
           <div class="content">
             <div class="title">{{ orderDetail.goods_name }}</div>
             <div class="desc">{{ orderDetail.contents }}</div>
-            
+
             <div class="money">
               <div class="label">{{$t('other.text11')}}:</div>
               <div class="num">{{ orderDetail.price }}</div>
@@ -28,7 +28,7 @@
               <div class="btn" @click="goToRechargePage">{{$t('other.text14')}}</div>
             </div>
           </div>
-        </div>  
+        </div>
       </template>
     </Bounced>
   </div>
@@ -42,7 +42,7 @@ export default {
   props: {
     orderDetail: {}
   },
-  data() {
+  data () {
     return {
       dialogVisible: false,
       timeServe: undefined,
@@ -50,47 +50,52 @@ export default {
 
     }
   },
-  mounted() {
+  mounted () {
 
   },
   methods: {
-    setOpen(dialogVisible) {
-      this.dialogVisible = dialogVisible === true;
+    setOpen (dialogVisible) {
+      this.dialogVisible = dialogVisible === true
       if (this.dialogVisible) {
         this.time = 15
         this.timeServe = setInterval(() => {
-          this.time--;
-          this.text = this.time;
+          this.time--
+          this.text = this.time
           if (this.time === 0) {
-            clearInterval(this.timeServe);
+            clearInterval(this.timeServe)
             this.timeServe = undefined
             this.dialogVisible = false
           }
-        }, 1000);
+        }, 1000)
       }
     },
 
-    handleClose() {
+    handleClose () {
       // 关闭弹窗
-      this.dialogVisible = false;
-      
+      this.dialogVisible = false
+
       // 清除倒计时定时器
       if (this.timeServe) {
-        clearInterval(this.timeServe);
-        this.timeServe = undefined;
+        clearInterval(this.timeServe)
+        this.timeServe = undefined
       }
-      
+
       // 重置倒计时时间(可选)
-      this.time = 0;
+      this.time = 0
     },
 
-    goToRechargePage() {
+    goToRechargePage () {
       this.$router.push('/recharge')
     }
   }
 }
 </script>
 
+<style lang="scss" scoped>
+::v-deep .el-dialog {
+  border-radius: 100px;
+}
+</style>
 <style lang="scss" scoped>
 /* 订单提交弹窗 */
 .order-detail-dialog {
@@ -219,4 +224,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 26 - 21
src/views/Forestage/Tourism/order-detail.vue

@@ -15,7 +15,7 @@
           <div class="content">
             <div class="title">{{ orderDetail.goods_name }}</div>
             <div class="desc">{{ orderDetail.contents }}</div>
-            
+
             <div class="money">
               <i class="item">
                 <div class="label">{{$t('other.text11')}}:</div>
@@ -29,7 +29,7 @@
               </i>
             </div>
           </div>
-        </div>  
+        </div>
       </template>
     </Bounced>
   </div>
@@ -43,7 +43,7 @@ export default {
   props: {
     orderDetail: {}
   },
-  data() {
+  data () {
     return {
       dialogVisible: false,
       timeServe: undefined,
@@ -51,43 +51,48 @@ export default {
 
     }
   },
-  mounted() {
+  mounted () {
 
   },
   methods: {
-    setOpen(dialogVisible) {
-      this.dialogVisible = dialogVisible === true;
+    setOpen (dialogVisible) {
+      this.dialogVisible = dialogVisible === true
       if (this.dialogVisible) {
         this.time = 15
         this.timeServe = setInterval(() => {
-          this.time--;
-          this.text = this.time;
+          this.time--
+          this.text = this.time
           if (this.time === 0) {
-            clearInterval(this.timeServe);
+            clearInterval(this.timeServe)
             this.timeServe = undefined
             this.dialogVisible = false
           }
-        }, 1000);
+        }, 1000)
       }
     },
 
-    handleClose() {
+    handleClose () {
       // 关闭弹窗
-      this.dialogVisible = false;
-      
+      this.dialogVisible = false
+
       // 清除倒计时定时器
       if (this.timeServe) {
-        clearInterval(this.timeServe);
-        this.timeServe = undefined;
+        clearInterval(this.timeServe)
+        this.timeServe = undefined
       }
-      
+
       // 重置倒计时时间(可选)
-      this.time = 0;
-    },
+      this.time = 0
+    }
   }
 }
 </script>
 
+<style lang="scss" scoped>
+::v-deep .el-dialog {
+  border-radius: 100px;
+}
+</style>
 <style lang="scss" scoped>
 /* 订单提交弹窗 */
 .order-detail-dialog {
@@ -168,7 +173,7 @@ export default {
           font-size: 20px;
           line-height: 50px;
         }
-  
+
         .num {
           color: #171717;
           font-size: 32px;
@@ -182,7 +187,7 @@ export default {
             font-weight: 700;
           }
         }
-  
+
         .unit {
           margin-left: 5px;
           color: #707070;
@@ -234,4 +239,4 @@ export default {
     }
   }
 }
-</style>
+</style>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 341 - 341
yarn.lock


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels