ltx529596 4 سال پیش
والد
کامیت
6f9206a0b7

+ 2 - 2
src/config/index.config.js

@@ -2,8 +2,8 @@ const CONFIG = {
     //开发环境配置
     development: {
         assetsPath: '/static', // 静态资源路径
-        baseUrl: 'http://tyou.xiudo.cn/merch',  // 后台接口请求地址
-        // baseUrl: 'http://192.168.100.135:83/merch',  // 后台接口请求地址
+        // baseUrl: 'http://tyou.xiudo.cn/merch',  // 后台接口请求地址
+        baseUrl: 'http://192.168.100.135:83/merch',  // 后台接口请求地址
         hostUrl: 'http://localhost:8080',        // H5地址(前端运行地址)
         websocketUrl: '',        // websocket服务端地址
         weixinAppId: '' // 微信公众号appid

+ 6 - 1
src/pages/index/index.vue

@@ -559,7 +559,12 @@ export default {
 
       let per = (((todaynum - yesnum) / yesnum) * 100).toFixed(2);
 
-      itemEle.percent = per.split('-')[1];
+      if (todaynum >= yesnum) {
+        itemEle.percent = per.split('-')[0];
+      } else {
+        itemEle.percent=per.per.split('-')[1];
+      }
+      
       if (yesnum === todaynum) {
         itemEle.percent = 0;
         itemEle.status = true;

+ 1 - 3
src/pages/index/setting/setting.vue

@@ -57,9 +57,7 @@ export default {
 				console.log(res);
 				this.$mHelper.toast('退出成功')
 				uni.removeStorageSync('user')
-				setTimeout(() => {
-					this.$mRouter.reLaunch({route: '/pages/public/login'})
-				}, 1000);
+				this.$mRouter.reLaunch({route: '/pages/public/login'})
 			});
 		}
 	}

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

@@ -252,6 +252,9 @@ export default {
   methods: {
     // 打开日历
     openTime() {
+      this.startdate ='';
+      this.enddate = '';
+      this.sunday = 1
       this.$refs.calendar.open();
     },
     // 确认时间后
@@ -261,10 +264,16 @@ export default {
 
       this.startdate = e.range.before;
       this.enddate = e.range.after;
+      if (!this.startdate || !this.enddate) {
+        this.startdate = e.fulldate
+        this.enddate = e.fulldate
+        this.sunday = 1;
+        this.params.overTimeArray = [this.startdate, this.enddate];
+        this.getOrderList();
+        return
+      }
       this.sunday = e.range.data.length;
-
       this.params.overTimeArray = [this.startdate, this.enddate];
-
       this.getOrderList();
     },
 

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

@@ -10,6 +10,7 @@
 				<view class="shopname titlebar">店铺名称:<text class="txt">{{orderMessage.shopName}}</text></view>
 				<view class="waternum titlebar" v-if="orderMessage.outOrderNo">流水号:<text class="txt">{{orderMessage.outOrderNo}}</text></view>
 				<view class="ordernum titlebar">订单号:<text class="txt">{{orderMessage.ordersNo}}</text></view>
+				<view class="ordernum titlebar">支付时间:<text class="txt">{{orderMessage.payTime}}</text></view>
 				<view class="phonenum titlebar">手机号:<text class="txt">{{orderMessage.buyPhone}}</text></view>
 				<view class="price titlebar">产品价格:<text class="txt">{{orderMessage.price | doMoney}}</text></view>
 				<view class="buynum titlebar">购买数量:<text class="txt">{{orderMessage.playManList.length}}</text></view>

+ 2 - 2
src/pages/shop/classify.vue

@@ -25,8 +25,8 @@
           >
         </view>
         <view class="warp-bottom">
-          <view class="btn edtil" @tap="compile(item)">编辑</view>
-          <view class="btn delet" @tap="delet(item.id)">删除</view>
+          <view class="btn edtil" v-if="item.code != 'none'" @tap="compile(item)">编辑</view>
+          <view class="btn delet" v-if="item.code != 'none'" @tap="delet(item.id)">删除</view>
         </view>
       </view>
     </view>

+ 48 - 13
src/pages/shop/shop.vue

@@ -97,7 +97,12 @@
           >
         </view>
         <view class="operate">
-          <view class="btn stick" id="one" @tap="sticktop(item.id)">置顶</view>
+          <view
+            class="btn stick"
+            :id="`${itemj.id}-btn`"
+            @tap="sticktop(item.id, topstatus)"
+            >{{ topstatus === '-1' ? '置顶' : '取消置顶' }}</view
+          >
           <!-- <view class="btn sold" @tap="passGet(item.id)">审核</view> -->
           <view class="btn compile" @tap="topage(item.id)">编辑</view>
           <view class="btn delete" @tap="deleteshop(item.id)">删除</view>
@@ -130,7 +135,12 @@
           >
         </view>
         <view class="operate">
-          <view class="btn stick" id="one" @tap="sticktop(item.id)">置顶</view>
+          <view
+            class="btn stick"
+            :id="`${itemj.id}-btn`"
+            @tap="sticktop(item.id, topstatus)"
+            >{{ topstatus === '-1' ? '置顶' : '取消置顶' }}</view
+          >
           <view class="btn sold" @tap="shopPutDown(item.id)">下架</view>
           <view class="btn compile" @tap="topage(item.id)">编辑</view>
           <view class="btn delete" @tap="deleteshop(item.id)">删除</view>
@@ -163,7 +173,12 @@
           >
         </view>
         <view class="operate">
-          <view class="btn stick" id="one" @tap="sticktop(item.id)">置顶</view>
+          <view
+            class="btn stick"
+            :id="`${itemj.id}-btn`"
+            @tap="sticktop(item.id, topstatus)"
+            >{{ topstatus === '-1' ? '置顶' : '取消置顶' }}</view
+          >
           <view class="btn sold" @tap="shopPutUp(item.id)">上架</view>
           <view class="btn compile" @tap="topage(item.id)">编辑</view>
           <view class="btn delete" @tap="deleteshop(item.id)">删除</view>
@@ -192,6 +207,7 @@ export default {
       shopArray: [{ name: '全部', id: '' }],
       shopID: '',
       index: 0,
+      topstatus: '-1', // 置顶传-1,取消置顶传-2
 
       isactive: 1,
       soleStatus: 1, // 触底状态
@@ -277,13 +293,14 @@ export default {
     },
     // 删除商品
     async deleteshop(id) {
-      let _self = this
+      let _self = this;
       this.deleteId = id;
       uni.showModal({
         content: '是否删除该商品?',
         success: (confirmRes) => {
           if (confirmRes.confirm) {
-            _self.$http.delete('/goods/del/' + this.deleteId)
+            _self.$http
+              .delete('/goods/del/' + this.deleteId)
               .then(async (res) => {
                 if (res.code === 200 && res.msg === 'OK') {
                   _self.$mHelper.toast('删除成功');
@@ -353,16 +370,34 @@ export default {
       this.getTicketShopList();
     },
     // 置顶
-    sticktop(id) {
-      this.$http.PUT('/goods/changeSort?id=' + id + '&sort=-1').then((res) => {
-        if (res.code === 200) {
-          setTimeout(() => {
-            this.$mHelper.toast('已将该商品置顶发布')
+    sticktop(id, status) {
+      let view = uni.createSelectorQuery().in(this).select(`#${id}-btn`);
+
+      view
+        .fields(
+          {
+            size: true,
+            scrollOffset: true,
+          },
+          (data) => {
+            console.log('得到节点信息' + JSON.stringify(data));
+            console.log('节点的宽为' + data.width);
+          }
+        )
+        .exec();
+      return;
+
+      this.$http
+        .PUT('/goods/changeSort?id=' + id + '&sort=' + status)
+        .then((res) => {
+          if (res.code === 200) {
+            console.log(res);
+            this.$mHelper.toast('已将该商品置顶发布');
             this.getTicketShopList();
-          }, 1000);
-        }
-      });
+          }
+        });
     },
+
     // 商品列表(待审核状态)
     async getTicketShopList() {
       this.soleStatus = 1;

+ 14 - 6
src/pages/shop/shopdetail.vue

@@ -147,7 +147,7 @@
           <view class="name">卖价:</view>
           <input
             class="price"
-            type="number"
+            type="text"
             v-model="price"
             placeholder="请输入卖价"
           />
@@ -157,7 +157,7 @@
           <view class="name">划线价:</view>
           <input
             class="price"
-            type="number"
+            type="text"
             v-model="rateprice"
             placeholder="请输入划线价"
           />
@@ -301,7 +301,7 @@
       <view class="iconcontent">
         <image class="shopLogo" :src="iconurl" v-if="iconurl"></image>
         <text class="icon" @tap="uploadImg">点击上传</text>
-        <text class="per">{{ progress }}%</text>
+        <text class="per">{{  uploadtxt  }} {{ progress=== 0 ? '' : progress }} <text v-if="progress!=0">%</text></text>
       </view>
       <view class="shopicon">商品图册</view>
       <view class="uploading">
@@ -395,6 +395,7 @@ export default {
       lineDidsable: true,
 
       // 图标上传
+      uploadtxt: '',
       progress: 0,
       iconurl: '',
       pickList: [],
@@ -409,7 +410,7 @@ export default {
       SHOPID: 0,
       shopData: {},
 
-      expirationDate: '请选择过期日期',
+      expirationDate: '请选择过商品期日期',
       // 销售属性
       patterList: [
         {
@@ -569,7 +570,7 @@ export default {
               if (this.shopData.expiredTime) {
                 this.expirationDate = this.shopData.expiredTime.slice(0, 10)
                   ? this.shopData.expiredTime.slice(0, 10)
-                  : '请选择过期日期';
+                  : '请选择商品过期日期';
               }
 
               let rule = JSON.parse(this.shopData.saleRuleJson);
@@ -767,11 +768,13 @@ export default {
     },
     // 线路分配
     async getLine() {
+      this.lineList = [{ name: '分类(请先选择所属商品)', id: '' }];
       await this.$http
         .get('/goods/getCustomGroupList', {
           shopId: this.storeId,
         })
         .then(async (res) => {
+          console.log(res);
           let arr = [];
           this.hasNameList = +res.data.shopFrom;
           res.data.customGroupList.forEach((element) => {
@@ -841,8 +844,9 @@ export default {
         success: function (res) {
           // 成功则返回图片的本地文件路径列表 tempFilePaths
           _self.iconurl = res.tempFilePaths[0];
+          _self.uploadtxt = '上传中...'
           myCloud.uploadFile({
-            url: 'http://192.168.100.135:83/merch/common/upload/oss',
+            url: 'http://tyou.xiudo.cn/merch/common/upload/oss',
             filePath: _self.iconurl, // 要上传的文件对象
             cloudPath: _self.iconurl, // 要上传的文件对象
             name: 'file',
@@ -855,6 +859,9 @@ export default {
               _self.progress = Math.round(
                 (progressEvent.loaded * 100) / progressEvent.total
               );
+              if ( _self.progress === 100) {
+                _self.uploadtxt = '上传成功'
+              }
             },
           });
         },
@@ -1249,6 +1256,7 @@ export default {
             flex: 1;
             height: 100%;
             line-height: 93upx;
+            color: #a3a8a8;
           }
         }
       }