ltx529596 4 роки тому
батько
коміт
e88ad30820

+ 14 - 8
src/pages.json

@@ -1,6 +1,14 @@
 {
   "pages": [
     {
+      "path": "pages/index/index",
+      "style": {
+        "navigationBarTitleText": "店铺首页",
+        "navigationBarTextStyle": "black",
+        "navigationBarBackgroundColor":"#ffcd00"
+      }
+    },
+    {
       "path": "pages/public/login",
       "style":{
         "navigationBarTitleText": "登录",
@@ -46,14 +54,6 @@
       }
     },
     {
-      "path": "pages/index/index",
-      "style": {
-        "navigationBarTitleText": "店铺首页",
-        "navigationBarTextStyle": "black",
-        "navigationBarBackgroundColor":"#ffcd00"
-      }
-    },
-    {
       "path":"pages/order/order",
       "style":{
         "navigationBarTitleText": "订单管理",
@@ -88,6 +88,12 @@
 			"style":{
 				"navigationBarTitleText": "商品详情"
 			}
+		},
+		{
+			"path":"pages/shop/classify",
+			"style":{
+				"navigationBarTitleText": "管理自定义分类"
+			}
 		}
   ],
   "tabBar": {

+ 107 - 0
src/pages/shop/classify.vue

@@ -0,0 +1,107 @@
+<!-- 管理分类 -->
+<template>
+  <view class="classify">
+    <Header :title="title" />
+    <view class="addClass" @tap="addClass">
+      <image src="../../static/images/addicon.png" class="addicon"></image>
+    </view>
+    <view style="height:94upx"></view>
+    <view class="content">
+      <view class="item-warp">
+        <view class="warp-top">
+          <view class="bar">分组名称:<text class="name">西线推荐</text></view>
+          <view class="bar">分组名称:<text class="name">西线推荐</text></view>
+          <view class="bar">分组名称:<text class="name">西线推荐</text></view>
+          <view class="bar">分组名称:<text class="name">西线推荐</text></view>
+        </view>
+        <view class="warp-bottom">
+          <view class="btn edtil">编辑</view>
+          <view class="btn delet">删除</view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import Header from '../components/header';
+export default {
+  name: 'classify',
+  components: { Header },
+  data() {
+    //这里存放数据
+    return {
+      title: '管理自定义分类'
+    };
+  },
+  
+  //方法集合
+  methods: {
+    addClass () {
+      console.log(1);
+    }
+  },
+ 
+};
+</script>
+<style lang='scss' scoped>
+  .classify {
+    .addClass{
+      position: fixed;
+      top: 24.5upx;
+      right: 33upx;
+      width: 48upx;
+      height: 48upx;
+      z-index: 100;
+      .addicon {
+        width: 48upx;
+        height: 48upx;
+      }
+    }
+    .content {
+      width: 100%;
+      padding: 24upx 32upx 0;
+      .item-warp{
+        width: 100%;
+        padding: 28upx 31upx 0;
+        border-radius: 10upx;
+        background-color: #ffffff;
+        .warp-top{
+          padding-bottom: 30upx;
+          border-bottom: 1px solid #e7e7e7;
+          .bar{
+            color: #7a7c7c;
+            font-size: 28upx;
+            margin-top: 10upx;
+            &:first-child{
+              margin-top: 0;
+            }
+            .name{
+              color: #202020;
+              margin-left: 5upx;
+            }
+          }
+        }
+        .warp-bottom{
+          display: flex;
+          padding: 17upx 0;
+          .btn{
+            width: 158upx;
+            height: 58upx;
+            text-align: center;
+            line-height: 58upx;
+            border: 1px solid #e2e2e2;
+            color: #7a7c7c;
+            margin-left: 275upx;
+          }
+          .delet {
+            color: #ffffff;
+            border: none;
+            margin-left: 23upx;
+            background-color: #ff6a5e;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 137 - 36
src/pages/shop/shopdetail.vue

@@ -130,30 +130,45 @@
       <!-- 商品图标 -->
       <view class="shopicon">商品图标</view>
       <view class="iconcontent">
-        <text class="icon" @tap="uploadImg"></text>
-        <image class="shopLogo" :src="img"></image>
+        <image class="shopLogo" :src="img" v-if="img"></image>
+        <text class="icon" @tap="uploadImg">点击上传</text>
       </view>
       <view class="shopicon">商品图册</view>
-      <view class="uploading"> </view>
+      <view class="uploading">
+        <view class="item-warp" v-for="(item, index) in pickList" :key="index">
+          <view class="img-warp">
+            <image :src="item" class="item list"></image>
+            <view class="delete">
+              <image
+                src="../../static/images/delete.png"
+                class="delete-icon"
+                @tap="deleteThisImg(index)"
+              ></image>
+            </view>
+          </view>
+        </view>
+        <view class="item-warp">
+          <image
+            src="../../static/images/upload.png"
+            class="item upload"
+            @tap="uploadList"
+          ></image>
+        </view>
+      </view>
       <!-- 购票须知 -->
       <view class="shopicon">商品描述(购票须知)</view>
       <view class="know">
-        <view class="txt-list">服务信息</view>
-        <view class="txt-list">本商品支付完成即可顺利出行,无需等待确认</view>
-        <view class="txt-list"
-          >本商品无需出团通知书/确认单,预定成功后即可出行</view
-        >
-        <view class="txt-list">取消政策</view>
-        <view class="txt-list">按规则退</view>
-        <view class="txt-list">旅游者违约退改规则</view>
-        <view class="txt-list">购买须知</view>
-        <view class="txt-list"
-          >商品过了使用期限后将不可再使用,请您一定要在使用时间</view
-        >
-        <view class="txt-list">范围内及时使用哦</view>
+        <view class="container">
+          <editor
+            id="editor"
+            class="ql-container"
+            :placeholder="placeholder"
+            @blur="onEditorReady"
+          ></editor>
+        </view>
       </view>
 
-      <view class="btn">确认</view>
+      <view class="btn" @tap="submitMesage">确认</view>
     </view>
   </view>
 </template>
@@ -172,6 +187,8 @@ export default {
       num2: 9999,
       showoperat: true,
       img: '',
+      pickList: [],
+      placeholder: '请输入内容...',
       storeList: [{ name: '所属店铺', id: '' }],
       storeIndex: 0,
       storeId: '',
@@ -198,6 +215,7 @@ export default {
     // 跳转到管理分类页面
     toClassify() {
       console.log('我跳了');
+      this.$mRouter.push({ route: '/pages/shop/classify' });
     },
     // 选择店铺
     changeStore(e) {
@@ -316,19 +334,61 @@ export default {
     addDate() {
       this.num2++;
     },
-
     // 图片上传
     uploadImg() {
+      let _self = this;
       uni.chooseImage({
-        count: 1, //
+        count: 1,
         sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
         sourceType: ['album'], // camera 使用相机   album 从相册中选
-        success: function (res) {  // 成功则返回图片的本地文件路径列表 tempFilePaths
-          console.log(res);
-          console.log(JSON.stringify(res.tempFilePaths));
+        success: function (res) {
+          // 成功则返回图片的本地文件路径列表 tempFilePaths
+
+          _self.img = res.tempFilePaths[0];
         },
       });
     },
+    // 图册上传
+    uploadList() {
+      let _self = this;
+      uni.chooseImage({
+        count: 6,
+        sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+        sourceType: ['album'], // camera 使用相机   album 从相册中选
+        success: function (res) {
+          // 成功则返回图片的本地文件路径列表 tempFilePaths
+          console.log(res.tempFilePaths);
+          let img = [];
+          img.push(res.tempFilePaths);
+          if (_self.pickList.length >= 6) {
+            _self.$mHelper.toast('最多只可上传6张图片');
+          } else {
+            _self.pickList = _self.pickList.concat(img);
+          }
+        },
+      });
+    },
+    // 删除图册中的图片
+    deleteThisImg(index) {
+      console.log(index);
+      this.pickList.splice(index, 1);
+    },
+    // 保存富文本
+    onEditorReady() {
+      uni
+        .createSelectorQuery()
+        .select('#editor')
+        .context((res) => {
+          this.editorCtx = res.context;
+        })
+        .exec();
+    },
+    // 清空富文本
+    // undo() {
+    //   this.editorCtx.undo();
+    // },
+    // 内容提交
+    submitMesage() {},
   },
 };
 </script>
@@ -434,34 +494,75 @@ export default {
       line-height: 100upx;
     }
     .iconcontent {
-      padding: 0 33upx;
+      padding: 25upx 33upx;
       background-color: #f9f9f9;
       display: flex;
       align-items: center;
-      height: 200upx;
       .icon {
         display: inline-block;
-        width: 156upx;
-        height: 156upx;
-        background-color: #b4b8b7;
+        height: 56upx;
+        font-size: 28upx;
+        color: #a3a8a8;
+        border-radius: 50%;
+        margin-left: 20upx;
+        border: 1px dashed #ccc;
+        border-radius: 5%;
+        text-align: center;
+        line-height: 56upx;
+        padding: 0 15upx;
       }
       .shopLogo {
-        width: 156upx;
-        height:156upx;
-        background-color: green;
+        width: 56upx;
+        height: 56upx;
+        border-radius: 50%;
       }
     }
     .uploading {
-      height: 208upx;
-      background-color: pink;
+      padding: 25upx 33upx;
+      display: flex;
+      align-items: center;
+      flex-wrap: wrap;
+      background-color: #fff;
+      .item-warp {
+        border-radius: 17upx;
+        margin-right: 15upx;
+        margin-bottom: 15upx;
+        box-sizing: border-box;
+        overflow: hidden;
+        .img-warp {
+          position: relative;
+        }
+        .item {
+          width: 160upx;
+          height: 160upx;
+        }
+        &:nth-child(4) {
+          margin-right: 0;
+        }
+        .delete {
+          position: absolute;
+          right: -35upx;
+          top: -35upx;
+          width: 70upx;
+          height: 70upx;
+          border-radius: 50%;
+          background-color: #8064f7;
+          .delete-icon {
+            position: absolute;
+            left: 13upx;
+            bottom: 13upx;
+            width: 14upx;
+            height: 14upx;
+          }
+        }
+      }
     }
     .know {
       padding: 24upx 33upx;
       background-color: #fff;
-      .txt-list {
-        font-size: 26upx;
-        color: #232828;
-        margin-bottom: 8upx;
+      #editor {
+        width: 100%;
+        height: 300px;
       }
     }
     .btn {

BIN
src/static/images/delete.png


BIN
src/static/images/upload.png