ltx529596 4 年 前
コミット
5d2be1a2de

+ 14 - 5
src/pages/index/index.vue

@@ -81,7 +81,10 @@
 								<view class="ratio">
 									<view class="detail">
 										<image src="../../static/images/down.png" class="icon" v-if="sellSun.yesnum >= sellSun.todaynum">
-										<image src="../../static/images/up.png" class="icon" v-if="sellSun.yesnum < sellSun.todaynum"> {{ sellSun.percent }}% <text class="compare">{{ sellSun.status ? '无增长' :'同比上月' }}</text>
+										<image src="../../static/images/up.png" class="icon" v-if="sellSun.yesnum < sellSun.todaynum">
+                     {{ sellSun.percent }}% 
+                     <!-- <text class="compare">{{ sellSun.status ? '无增长' :'同比上月' }}</text> -->
+                     <text class="compare">同比上月</text>
 									</view>
 								</view>
 							</view>
@@ -100,7 +103,9 @@
 								<view class="ratio">
 									<view class="detail">
 										<image src="../../static/images/down.png" class="icon" v-if="orderSun.yesnum >=orderSun.todaynum">
-										<image src="../../static/images/up.png" class="icon" v-if="orderSun.yesnum < orderSun.todaynum"> {{ orderSun.percent }}% <text class="compare">{{ orderSun.status ? '无增长' :'同比上月' }}</text>
+										<image src="../../static/images/up.png" class="icon" v-if="orderSun.yesnum < orderSun.todaynum"> {{ orderSun.percent }}% 
+                    <!-- <text class="compare">{{ orderSun.status ? '无增长' :'同比上月' }}</text> -->
+                    <text class="compare">同比上月</text>
 									</view>
 								</view>
 							</view>
@@ -119,7 +124,9 @@
 								<view class="ratio">
 									<view class="detail">
 										<image src="../../static/images/down.png" class="icon" v-if="todaysellSun.yesnum >= todaysellSun.todaynum">
-										<image src="../../static/images/up.png" class="icon" v-if="todaysellSun.yesnum < todaysellSun.todaynum"> {{ todaysellSun.percent }}% <text class="compare">{{ todaysellSun.status ? '无增长' :'同比上月' }}</text>
+										<image src="../../static/images/up.png" class="icon" v-if="todaysellSun.yesnum < todaysellSun.todaynum"> {{ todaysellSun.percent }}%
+                   <!-- <text class="compare">{{ todaysellSun.status ? '无增长' :'同比昨日' }}</text> -->
+                   <text class="compare">同比昨日</text>
 									</view>
 								</view>
 							</view>
@@ -138,7 +145,9 @@
 								<view class="ratio">
 									<view class="detail">
                     <image src="../../static/images/down.png" class="icon" v-if="todayorderSun.yesnum >=todayorderSun.todaynum">
-										<image src="../../static/images/up.png" class="icon" v-if="todayorderSun.yesnum < todayorderSun.todaynum"> {{ todayorderSun.percent }}% <text class="compare">{{ todayorderSun.status ? '无增长' :'同比上月' }}</text>
+										<image src="../../static/images/up.png" class="icon" v-if="todayorderSun.yesnum < todayorderSun.todaynum"> {{ todayorderSun.percent }}% 
+                    <!-- <text class="compare">{{ todayorderSun.status ? '无增长' :'同比上月' }}</text> -->
+                    <text class="compare">同比昨日</text>
 									</view>
 								</view>
 							</view>
@@ -332,7 +341,7 @@ export default {
 
       orderMessage: {},
 
-      today: moment().format('YYYY-MM-DD'),
+      today: moment().format('YYYY-MM-DD HH:mm:ss'),
       this_day: moment().format('YYYY.MM.DD'),
 
       // 数据还可以优化

+ 8 - 6
src/pages/index/setting/editnotice.vue

@@ -214,15 +214,14 @@ export default {
         success: function (res) {
           // 成功则返回图片的本地文件路径列表 tempFilePaths
           _self.iconUrl = res.tempFilePaths[0];
+          console.log(res);
           const uploadTask = uni.uploadFile({
-						url: 'http://192.168.100.135:83/merch/common/upload/oss',
-						filePath: _self.iconUrl,
+						url: 'http://tyou.xiudo.cn/merch/common/upload/oss',
+            filePath: _self.iconUrl,
+            header:{'content-type': 'multipart/form-data'},
 						name: 'file',
-						formData: {
-							'user': 'test'
-						},
 						success:(res)=>{
-							let data = JSON.parse(res.data)
+              let data = JSON.parse(res.data)
 							console.log(data);
 							_self.noticeMessage.icon = data.data
 						},
@@ -234,6 +233,9 @@ export default {
 						}, 500);
 					})
         },
+        fail: function (error) {
+          console.log(error);
+        }
       });
     },
   },

+ 5 - 0
src/pages/order/order.vue

@@ -269,7 +269,11 @@ export default {
     this.enddate = '';
     this.sunday = 1;
     this.dateArr = [];
+    this.index = 0
     this.params.pageNum = 1;
+    this.params.buyPhone = '';
+    this.params.ordersNo = '';
+    this.params.shopId = '';
     this.params.overTimeArray = [
       moment().format('YYYY-MM-DD'),
       moment().format('YYYY-MM-DD'),
@@ -314,6 +318,7 @@ export default {
         //滑动方向
         this.direction = endX - this.startX > 0 ? 'right' : 'left';
         console.log(this.direction);
+        this.more = 'loading'
         if (this.direction === 'right') {
           this.isactive--;
           this.params.orderFlag = this.flagList[this.isactive];

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

@@ -26,7 +26,7 @@
 			</view>
 			<view class="paymessage">
 				<view class="title">支付信息</view>
-				<view class="shoppric">产品价格:<text class="money">{{orderMessage.ordersPrice | doMoney}}</text></view>
+				<view class="shoppric">产品价格:<text class="money">{{orderMessage.price | doMoney}}</text></view>
 				<view class="realitypirc">实付金额:<text class="money">{{orderMessage.ordersPrice | doMoney}}</text></view>
 			</view>
 		</view>

+ 5 - 11
src/pages/shop/shop.vue

@@ -92,9 +92,8 @@
             >
           </view>
 
-          <view class="right"
-            >¥<text class="price">{{ item.price | dounit }}</text></view
-          >
+          <view class="right" v-if="item.price">¥<text class="price">{{ item.price | dounit }}</text></view>
+          
         </view>
         <view class="operate">
           <view
@@ -130,9 +129,7 @@
             >
           </view>
 
-          <view class="right"
-            >¥<text class="price">{{ item.price | dounit }}</text></view
-          >
+          <view class="right" v-if="item.price">¥<text class="price">{{ item.price | dounit }}</text></view>
         </view>
         <view class="operate">
           <view
@@ -168,7 +165,7 @@
             >
           </view>
 
-          <view class="right"
+          <view class="right" v-if="item.price"
             >¥<text class="price">{{ item.price | dounit }}</text></view
           >
         </view>
@@ -250,7 +247,7 @@ export default {
       if (val) {
         return val / 100;
       } else {
-        return '0.00';
+        return '';
       }
     },
   },
@@ -380,7 +377,6 @@ export default {
         .PUT('/goods/changeSort?id=' + id + '&sort=' + this.topstatus)
         .then((res) => {
           if (res.code === 200) {
-            console.log(res);
             if (status != 0) {
               this.$mHelper.toast('取消成功');
             } else {
@@ -403,7 +399,6 @@ export default {
         delete this.params.upDown;
       }
       await this.$http.get('/goods/list', this.params).then((res) => {
-        console.log(res);
         if (res.data.list.length > 0) {
           this.shoplist = res.data.list;
           if (res.data.nextPage === 0) {
@@ -632,7 +627,6 @@ export default {
       .order-detail {
         margin-top: 24upx;
         display: flex;
-        justify-content: center;
         .left {
           .img {
             width: 120upx;

+ 49 - 30
src/pages/shop/shopdetail.vue

@@ -410,7 +410,7 @@ export default {
       SHOPID: 0,
       shopData: {},
 
-      expirationDate: '请选择商品期日期',
+      expirationDate: '请选择商品期日期',
       // 销售属性
       patterList: [
         {
@@ -473,21 +473,27 @@ export default {
     uni.removeStorageSync('Id');
   },
   onShow() {
-    this.getShopList();
-
-    // ---------------------------------------------------
-    this.SHOPID = uni.getStorageSync('Id');
-    if (this.SHOPID) {
-      this.getShopBuyId();
+    if (this.storeId != '') {
+      this.getLine()
     }
   },
-  onLoad() {
+  onReady (){
     myCloud = uniCloud.init({
       provider: 'aliyun',
       spaceId: 'db8671a1-69bd-470d-ad59-ba927c88f4a4',
       clientSecret: '8nOzV70edtpCd0El6qce3g==',
     });
   },
+  onLoad() {
+    this.getShopList();
+
+    // ---------------------------------------------------
+    this.SHOPID = uni.getStorageSync('Id');
+    if (this.SHOPID) {
+      this.getShopBuyId();
+    }
+   
+  },
   methods: {
     // 打开日历
     openTime() {
@@ -557,8 +563,8 @@ export default {
         .get('/goods/getById/' + this.SHOPID)
         .then(async (res) => {
           if (res.code === 200 && res.msg === 'OK') {
-            console.log(res);
             this.shopData = res.data;
+            console.log(this.shopData);
 
             this.getShopList();
 
@@ -766,6 +772,19 @@ export default {
             arr.push({ name: element.ticket_name, id: element.ticket_no });
           });
           this.shopList = this.shopList.concat(arr);
+
+          // 回显名称
+          if (this.shopData.name) {
+            this.shopList.forEach((item, index) => {
+              if (this.shopData.name === item.name) {
+                this.shopIndex = index;
+              } else {
+                this.shopIndex = 0
+                this.shopList[0].name = this.shopData.name
+              }
+            });
+            this.shopId = this.shopList[this.shopIndex].id;
+          }
         });
     },
     // 线路分配
@@ -787,15 +806,6 @@ export default {
           // 可选择商品名称回显
           if (this.shopData.name) {
             this.getShopName();
-            this.shopList.forEach((item, index) => {
-              if (this.shopData.name === item.name) {
-                this.shopIndex = index;
-              } else {
-                this.shopIndex = 0;
-                this.shopList[0].name = this.shopData.name
-              }
-            });
-            this.shopId = this.shopList[this.shopIndex].id;
           }
 
           // 分类回显
@@ -838,6 +848,8 @@ export default {
     // 图标上传
     uploadImg() {
       let _self = this;
+      _self.uploadtxt = '上传中...'
+      _self.progress = 0
       uni.chooseImage({
         count: 1,
         sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
@@ -845,7 +857,6 @@ export default {
         success: function (res) {
           // 成功则返回图片的本地文件路径列表 tempFilePaths
           _self.iconurl = res.tempFilePaths[0];
-          _self.uploadtxt = '上传中...'
           myCloud.uploadFile({
             url: 'http://tyou.xiudo.cn/merch/common/upload/oss',
             filePath: _self.iconurl, // 要上传的文件对象
@@ -856,16 +867,21 @@ export default {
                 _self.Icon = res.fileID;
               }
             },
+            fail: function (msg) {
+              console.log(msg);
+            },
             onUploadProgress: function (progressEvent) {
-              _self.progress = Math.round(
-                (progressEvent.loaded * 100) / progressEvent.total
-              );
+              _self.progress = Math.round((progressEvent.loaded * 100) / progressEvent.total);
               if ( _self.progress === 100) {
                 _self.uploadtxt = '上传成功'
               }
             },
           });
         },
+        fail: function (error) {
+          console.log(error);
+          _self.uploadtxt = '已取消上传'
+        }
       });
     },
     // 图册上传
@@ -925,10 +941,16 @@ export default {
       }
       // 判断是否可以自定义商品名称
       let name = '';
+      console.log(this.shopList.length);
       if (this.shopList.length === 1) {
         name = this.shopname;
-      } else {
-        name = this.shopList[this.shopIndex].id;
+      }
+      else {
+        if (this.shopList[0].name != '商品名称(请先选择商品类型)') {
+          name = this.shopList[this.shopIndex].name;
+        } else {
+          name = this.shopList[this.shopIndex].id;
+        }
       }
       if (!this.storeId) {
         this.$mHelper.toast('请选择所属商铺!');
@@ -961,7 +983,6 @@ export default {
           this.$mHelper.toast('请选择商品过期日期');
           return;
         }
-
         if (this.shopIndex === 0) {
           this.inventory = '';
         }
@@ -979,7 +1000,6 @@ export default {
             return;
           }
         }
-
         if (!this.astrictDate.data.bookRule) {
           this.$mHelper.toast('请输入预订数量!');
           return;
@@ -1001,10 +1021,9 @@ export default {
           saleRuleJson: JSON.stringify(this.astrictDate),
           //  自营
           name: name,
-          salePrice: this.price * 100 || '',
-          price: this.rateprice * 100 || '',
-          expiredTime:
-            this.expirationDate === '商品过期日期' ? '' : this.expirationDate,
+          salePrice: this.price * 100 || null,
+          price: this.rateprice * 100 || null,
+          expiredTime: this.expirationDate === '请选择商品过期日期' ? '' : this.expirationDate,
           inventory: this.inventory,
         })
         .then((res) => {