廖雁生 9 місяців тому
батько
коміт
7b584bd4d4

+ 2 - 2
toktok-admin-screen/config/prod.env.js

@@ -1,6 +1,6 @@
 module.exports = {
   NODE_ENV: '"production"',
   ENV_CONFIG: '"prod"',
-  BASE_API: '"http://stores.test.toktok.beer/tsa"'
-  // BASE_API: '"https://stores.toktok.beer/tsa"'
+//   BASE_API: '"http://stores.test.toktok.beer/tsa"'
+  BASE_API: '"https://stores.toktok.beer/tsa"'
 }

+ 8 - 0
toktok-admin-screen/src/api/projection.js

@@ -107,6 +107,14 @@ export function public_data_dishes_type(param) {
 		params: param
 	})
 }
+//菜单类型列表
+export function public_data_menu_type(param) {
+	return request({
+		url: '/public_data/list/menu_type',
+		method: 'get',
+		params: param
+	})
+}
 //新增啤酒
 export function beer_add(param) {
 	return request({

+ 44 - 16
toktok-admin-screen/src/views/toktok-stores/projection.vue

@@ -610,33 +610,49 @@ export default {
 			},
 		],
 		genTypeList: [
-		{
-			name: '无',
-			value: '0'
-			},
+      {
+        name: '无',
+        value: '0'
+      },
 			{
-			name: '啤酒(10)',
-			value: '1'
+        name: '啤酒(10)',
+        value: '1'
 			},
 			{
-			name: '小吃',
-			value: '2'
+        name: '小吃',
+        value: '2'
 			},
 			{
-			name: '咖啡',
-			value: '3'
+        name: '咖啡',
+        value: '3'
 			},
 			{
-			name: '水果茶',
-			value: '4'
+        name: '水果茶',
+        value: '4'
 			},
 			{
-			name: '啤酒(6)',
-			value: '5'
+        name: '啤酒(6)',
+        value: '5'
 			},
       {
-			name: '鸡尾酒',
-			value: '6'
+        name: '鸡尾酒',
+        value: '6'
+			},
+      {
+        name: '早餐',
+        value: '7'
+			},
+      {
+        name: '午餐',
+        value: '8'
+			},
+      {
+        name: '下午茶',
+        value: '9'
+			},
+      {
+        name: '晚餐',
+        value: '10'
 			},
 		],
 		dialogVisible_add: false,
@@ -1190,6 +1206,18 @@ export default {
         case 6:
 				return '鸡尾酒'
 				break;
+        case 7:
+				return '早餐'
+				break;
+        case 8:
+				return '午餐'
+				break;
+        case 9:
+				return '下午茶'
+				break;
+        case 10:
+				return '晚餐'
+				break;
 				default:
 				return ''
 			}

+ 3 - 2
toktok-admin-screen/src/views/toktok-stores/quanliang_group.vue

@@ -159,7 +159,7 @@ export default {
 			dialogVisible_add: false,
 			dialogVisible_chat: false,
 			managerList: [],
-            group_list: [],
+      group_list: [],
 			chatParams: {
 				// userid: null,
         quanliangGroupIds: null,
@@ -217,8 +217,9 @@ export default {
 		sendChat() {
 			this.chatParams.imgUrls = this.chatParams.imgUrls_arr.join(';');
       this.chatParams.quanliangGroupIds = this.chatParams.quanliangGroupIds_arr.join(';');
+      const regex = /\[([^\]]*)\]/g;
       let chat_Params = {
-        content: encodeURIComponent(this.chatParams.content),
+        content: this.chatParams.content.replace(regex, (match) => encodeURI(match)),
         imgUrls: this.chatParams.imgUrls,
         quanliangGroupIds: this.chatParams.quanliangGroupIds
       }

+ 6 - 5
toktok-admin-screen/src/views/toktok-stores/stores_menu_manage.vue

@@ -5,7 +5,7 @@
       <el-select v-model="listQuery.storeId" class="filter-item" @change="handleFilter">
         <el-option v-for="item in storeList" :key="item.storeId" :label="item.name" :value="item.storeId" />
       </el-select>
-      <el-select v-model="listQuery.type" class="filter-item" @change="handleFilter">
+      <el-select v-model="listQuery.menuType" class="filter-item" @change="handleFilter">
         <el-option v-for="item in typeList" :key="item.value" :label="item.name" :value="item.value" />
       </el-select>
       <el-select v-model="listQuery.status" class="filter-item" @change="handleFilter">
@@ -71,7 +71,7 @@
 <script>
 import { store_list, stores_menu_list, stores_menu_add, stores_menu_remove,
    stores_menu_update, stores_menu_update_store, stores_menu_update_sort_by,
-    all_store_update, public_data_dishes_type } from '@/api/projection'
+    all_store_update, public_data_menu_type } from '@/api/projection'
 import { deepClone, parseTime } from '@/utils'
 import { scrollTo } from '@/utils/scrollTo'
 
@@ -80,13 +80,13 @@ export default {
     return {
       listQuery: {
         storeId: null,
-        type: 1,
+        menuType: 0,
         status: 'On',
         currentPage: 1,
         pageSize: 100,
       },
       storeList: [],
-      typeList: [      ],
+      typeList: [],
       statusList: [
         {
           name: '上架',
@@ -169,6 +169,7 @@ export default {
     putOnOff(dishesId) {
       let parmas = {
         dishesId: dishesId,
+        menuType: this.listQuery.menuType,
         storeId: this.listQuery.storeId
       }
       if(this.listQuery.status=='On') {
@@ -198,7 +199,7 @@ export default {
       })
     },
     get_dishes_type() {
-      public_data_dishes_type().then((res) => {
+      public_data_menu_type().then((res) => {
         this.typeList = res.data.data;
       })
     },

+ 1 - 1
toktok-menu-manager/config/index.js

@@ -13,7 +13,7 @@ module.exports = {
     proxyTable: {},
 
     // Various Dev Server settings
-    host: '192.168.2.65', // can be overwritten by process.env.HOST
+    host: 'localhost', // can be overwritten by process.env.HOST
     port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,

+ 107 - 107
toktok-menu-manager/src/action/net.js

@@ -1,107 +1,107 @@
-import axios from 'axios'
-import qs from 'qs'
-
-var banruo_debug = false;//true测试环境false生产环境
-axios.defaults.baseURL = banruo_debug ? 'http://work.test.toktok.beer' : 'http://work.toktok.beer';//配置接口地址
-axios.defaults.timeout = 15000;//响应时间
-axios.defaults.headers.get['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';  //此处是增加的代码,设置请求头的类型
-axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';//配置请求头
-axios.defaults.headers.common["My-User-Agent"] = "H5#H5#201#201";
-
-
-// POST传参序列化(添加请求拦截器)
-// axios.interceptors.request.use((config) => {
-//     //在发送请求之前做某件事
-//     if(config.method  === 'post'){
-//         config.data = qs.stringify(config.data);
-//     }
-//     return config;
-// },(error) =>{
-//     console.log('错误的传参')
-//     return Promise.reject(error);
-// });
-
-/* 请求拦截 */
-axios.interceptors.request.use(
-    config => {
-        if (localStorage.getItem("token") != null) {
-        config.headers["Auth-Token"] = localStorage.getItem("token");
-        }
-        return config;
-    },
-    err => Promise.reject(err)
-);
-
-//返回状态判断(添加响应拦截器)
-axios.interceptors.response.use((res) =>{
-    //对响应数据做些事
-    if(!res.data.success){
-        return Promise.resolve(res);
-    }
-    return res;
-}, (error) => {
-    console.log('网络异常')
-    return Promise.reject(error);
-});
-
-export default {
-    banruo_debug,
-    sendRequest(method, url, params) {
-        return new Promise((resolve, reject) => {
-            // axios.defaults.headers.common["Auth-Token"] = localStorage.getItem('token')
-            if(method == 'GET'){
-                axios.get(url, {params: params})
-                .then(response => {
-                    resolve(response)
-                }, err => {
-                    reject(err)
-                })
-                .catch((error) => {
-                    reject(error)
-                })
-            }else if(method == 'POST'){
-                axios.post(url, params)
-                .then(response => {
-                    resolve(response);
-                }, err => {
-                    reject(err);
-                })
-                .catch((error) => {
-                    reject(error)
-                })
-            }
-        })
-    },
-    //返回一个Promise(发送post请求)
-    fetchPost(url, params) {
-        return new Promise((resolve, reject) => {
-            axios.post(url, params)
-                .then(response => {
-                    resolve(response);
-                }, err => {
-                    reject(err);
-                })
-                .catch((error) => {
-                    reject(error)
-                })
-        })
-    },
-    //返回一个Promise(发送get请求)
-    fetchGet(url, param) {
-        return new Promise((resolve, reject) => {
-            axios.get(url, {params: param})
-                .then(response => {
-                    resolve(response)
-                }, err => {
-                    reject(err)
-                })
-                .catch((error) => {
-                    reject(error)
-                })
-        })
-    },
-    //获取URL参数
-    getUrlKey (name) {
-        return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
-    }
-}
+import axios from 'axios'
+import qs from 'qs'
+
+var banruo_debug = false;//true测试环境false生产环境
+axios.defaults.baseURL = banruo_debug ? 'http://work.test.toktok.beer' : 'http://work.toktok.beer';//配置接口地址
+axios.defaults.timeout = 15000;//响应时间
+axios.defaults.headers.get['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';  //此处是增加的代码,设置请求头的类型
+axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';//配置请求头
+axios.defaults.headers.common["My-User-Agent"] = "H5#H5#201#201";
+
+
+// POST传参序列化(添加请求拦截器)
+// axios.interceptors.request.use((config) => {
+//     //在发送请求之前做某件事
+//     if(config.method  === 'post'){
+//         config.data = qs.stringify(config.data);
+//     }
+//     return config;
+// },(error) =>{
+//     console.log('错误的传参')
+//     return Promise.reject(error);
+// });
+
+/* 请求拦截 */
+axios.interceptors.request.use(
+    config => {
+        if (localStorage.getItem("token") != null) {
+        config.headers["Auth-Token"] = localStorage.getItem("token");
+        }
+        return config;
+    },
+    err => Promise.reject(err)
+);
+
+//返回状态判断(添加响应拦截器)
+axios.interceptors.response.use((res) =>{
+    //对响应数据做些事
+    if(!res.data.success){
+        return Promise.resolve(res);
+    }
+    return res;
+}, (error) => {
+    console.log('网络异常')
+    return Promise.reject(error);
+});
+
+export default {
+    banruo_debug,
+    sendRequest(method, url, params) {
+        return new Promise((resolve, reject) => {
+            // axios.defaults.headers.common["Auth-Token"] = localStorage.getItem('token')
+            if(method == 'GET'){
+                axios.get(url, {params: params})
+                .then(response => {
+                    resolve(response)
+                }, err => {
+                    reject(err)
+                })
+                .catch((error) => {
+                    reject(error)
+                })
+            }else if(method == 'POST'){
+                axios.post(url, params)
+                .then(response => {
+                    resolve(response);
+                }, err => {
+                    reject(err);
+                })
+                .catch((error) => {
+                    reject(error)
+                })
+            }
+        })
+    },
+    //返回一个Promise(发送post请求)
+    fetchPost(url, params) {
+        return new Promise((resolve, reject) => {
+            axios.post(url, params)
+                .then(response => {
+                    resolve(response);
+                }, err => {
+                    reject(err);
+                })
+                .catch((error) => {
+                    reject(error)
+                })
+        })
+    },
+    //返回一个Promise(发送get请求)
+    fetchGet(url, param) {
+        return new Promise((resolve, reject) => {
+            axios.get(url, {params: param})
+                .then(response => {
+                    resolve(response)
+                }, err => {
+                    reject(err)
+                })
+                .catch((error) => {
+                    reject(error)
+                })
+        })
+    },
+    //获取URL参数
+    getUrlKey (name) {
+        return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
+    }
+}

+ 21 - 10
toktok-menu-manager/src/pages/index.vue

@@ -1,8 +1,8 @@
 <template>
 	<div>
         <div class="select-box">
-            <span>类:</span>
-            <select name="" id="" v-model="store_params.type" @change='reloadData'>
+            <span>类:</span>
+            <select name="" id="" v-model="store_params.menuType" @change='reloadData'>
                 <option v-for="(item, index) in typeList" :key="index" :value="item.value">{{item.name}}</option>
             </select>
             <span>状态:</span>
@@ -10,7 +10,7 @@
                 <option value="On">在售</option>
                 <option value="Off">未上架</option>
             </select>
-            <button @click="update2store">生成菜单</button>            
+            <button @click="update2store">生成菜单</button>
         </div>
         <div class="search-box">
             <div class="beer-search">
@@ -26,11 +26,12 @@
             <div class="goods" v-for="(item, index) in onsale_data" :key="index">
                 <img v-if="item.img" class="goods-img" :src="item.img" alt="">
                 <img v-else class="goods-img" src="../assets/snack.jpg" alt="">
-                <div class="goods-name" :style="store_params.type==1?'top: 20px;':''">{{item.name}}</div>
-                <div v-show="store_params.type==1" class="goods-sort">
+                <div class="goods-name" :style="store_params.menuType==0?'top: 10px;':''">{{item.name}}</div>
+                <div v-show="store_params.menuType==0" class="goods-sort">
                     <span>排序:</span>
                     <input type="number" @blur="blurFun($event, index)" :value="index+1" placeholder="排序号">
                 </div>
+                <div class="goods-pri">小杯:{{ smallBeerPrice }}元</div>
                 <div class="goods-sale" @click="putOff(item.dishesId, index)">下架</div>
             </div>
         </div>
@@ -72,7 +73,7 @@ export default {
             storeId: null,//33003100,
             store_params: {
                 status: 'On',//Off
-                type: '1',//1:啤酒,2:小吃 3:咖啡 4:主食 5:糕点
+                menuType: '0',
                 pageSize: 100,
                 currentPage: 1,
                 keyword: ''
@@ -83,7 +84,7 @@ export default {
             },
             pages: null,
             onsale_data: [
-                
+
             ],
             store_name: '',
             typeList: []
@@ -146,6 +147,7 @@ export default {
         putOff(id, index) {
             let that = this;
             that.put_params = {
+                menuType: that.store_params.menuType,
                 storeId: that.storeId,
                 dishesId: id
             }
@@ -165,6 +167,7 @@ export default {
         putOn(id, index) {
             let that = this;
             that.put_params = {
+                menuType: that.store_params.menuType,
                 storeId: that.storeId,
                 dishesId: id
             }
@@ -242,7 +245,7 @@ export default {
         },
         getTypeList() {
             let that = this;
-            net.sendRequest('GET','/oa/menu/type/dishes/list',{})
+            net.sendRequest('GET','/oa/menu/type/menu/list',{})
             .then((res) => {
                 if(res.data.code != 200) {
                     console.log('请求失败'+res.data.code);
@@ -299,6 +302,7 @@ export default {
             })
             .catch((err)=>{
                 console.log(err);
+                that.closeLoading();
             });
         },
         clickStatus(status) {
@@ -444,7 +448,7 @@ export default {
 }
 .goods-sort{
     position: absolute;
-    top: 60px;
+    top: 70px;
     left: 106px;
     font-size: 16px;
 }
@@ -457,6 +461,13 @@ export default {
     background: #f1f1f1;
     font-size: 16px;
 }
+.goods-pri{
+    position: absolute;
+    top: 40px;
+    left: 106px;
+    color: #5d5d5d;
+    font-size: 16px;
+}
 .goods-sale{
     position: absolute;
     top: 40px;
@@ -473,4 +484,4 @@ export default {
     /* box-shadow: -3px -3px 0px #ddd,3px 3px 0px #333; */
 }
 
-</style>
+</style>

+ 2 - 2
toktok-wx-applet/pages/beerBoxDetail/beerBoxDetail.wxml

@@ -72,7 +72,7 @@
 </view>
 <view class="item-msg">
   <text>1</text>
-  <text>订购活动提示每月低价惊喜, 周期较长, 若想直接购买酒, 可移至“TOKTOK精酿商城”小程序选购哦</text>
+  <text>鲜啤罐装后,不能回桶,故不支持7天无理由退换,非质量问题不给予退换</text>
 </view>
 <view class="item-msg">
   <text>2</text>
@@ -84,7 +84,7 @@
 </view>
 <view class="item-msg">
   <text>4</text>
-  <text>小酌怡情, 与新友共饮更欢乐</text>
+  <text>小酌怡情,亲朋好友共饮更欢乐</text>
 </view>
 
 <view class="buy-btn-empty"></view>

+ 4 - 1
toktok-wx-applet/pages/beerFactory/beerFactory.wxss

@@ -72,7 +72,7 @@
   position: absolute;
   bottom: 32rpx;
   left: 32rpx;
-  width: auto;
+  width: 622rpx;
   height: 42rpx;
   font-size: 15px;
   font-family: PingFangSC-Semibold, PingFang SC;
@@ -80,6 +80,9 @@
   color: #FFFFFF;
   line-height: 42rpx;
   text-align: left;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
 }
 .beer-more{
   width: 750rpx;

+ 1 - 1
toktok-wx-applet/utils/request.js

@@ -1,4 +1,4 @@
-var _debug = true;
+var _debug = false;
 var host = _debug ? 'https://test.toktok.beer/' : 'https://app.toktok.beer/';
 //http://192.168.2.65:7500/
 //https://test.toktok.beer/