This commit is contained in:
魏啾
2024-06-05 16:07:13 +08:00
11 changed files with 73 additions and 31 deletions

View File

@@ -19,9 +19,9 @@ const baseUrlwws = 'ws://cashier.sxczgkj.cn/cashierService'
// const baseUrl = 'https://cashier.sxczgkj.cn/cashierService'// 线上
// const baseUrlwws = 'wss://cashier.sxczgkj.cn/cashierService' // 线上
// const baseUrl = 'http://192.168.2.42:9888/cashierService'// 测试-w
// const baseUrlwws ='ws://192.168.2.42:9888/cashierService' // 测试-w
const baseUrlwws ='wss://192.168.2.42:9999/cashierService' // 测试-w
const baseUrl = 'https://wxcashiertest.sxczgkj.cn/cashierService'// 测试
const baseUrlwws ='wss://wxcashiertest.sxczgkj.cn/cashierService' // 测试
// const baseUrlwws ='wss://wxcashiertest.sxczgkj.cn/cashierService' // 测试
// #endif

View File

@@ -56,7 +56,7 @@
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxc2bb94c0ddda1032",
"appid" : "wxd88fffa983758a30",
"setting" : {
"urlCheck" : false,
"minified" : true,

View File

@@ -15,7 +15,7 @@
<view class="therecontent_box_itembox">
<view class="therecontent_box_itembox_item flex-between" v-for="(item,index) in todayList.todayList"
:key="index" @click="clickproduct(item)">
<image :src="item.image" mode="aspectFill"></image>
<image :src="`${item.image}?x-oss-process=image/resize,m_lfit,w_114,h_136`" mode="aspectFill"></image>
<view class="therecontent_box_itembox_itemview flex-colum-start">
<view class="therecontent_box_itembox_itemviewone">
<text
@@ -53,7 +53,7 @@
<view class="therecontent_box_itembox">
<view class="therecontent_box_itembox_item flex-between" v-for="(item,index) in salesList.hotList"
:key="index" @click="clickproduct(item)">
<image :src="item.image" mode="aspectFill"></image>
<image :src="`${item.image}?x-oss-process=image/resize,m_lfit,w_114,h_136`" mode="aspectFill"></image>
<view class="therecontent_box_itembox_itemview flex-colum-start">
<view class="therecontent_box_itembox_itemviewone flex-start">
<view class="therecontent_box_itembox_itemviewoneafter">

View File

@@ -155,12 +155,12 @@
uni.getStorage({
key: 'itemData',
success: function(res) {
console.log(res.data,'数据');
_this.type = res.data.value
_this.distiricttopCommon()
setTimeout(() => {
// setTimeout(() => {
_this.GetTop()
}, 1000)
// _this.init_fn()
// }, 1000)
}
});
// this.type = e.value
@@ -170,7 +170,19 @@
// }, 1000)
},
onShow() {
this.init_fn()
let _this = this
uni.getStorage({
key: 'itemData',
success: function(res) {
_this.type = res.data.value
_this.distiricttopCommon()
// setTimeout(() => {
// _this.GetTop()
_this.init_fn()
// }, 1000)
}
});
// this.init_fn()
},
computed: {
HeighT() { //手机类型的尺寸

View File

@@ -93,7 +93,7 @@
</view>
<view class="fivecontent_item_box">
<view class="fivecontent_item_boxitem flex-between">
<image :src="item.image" mode=""></image>
<image :src="`${item.image}?x-oss-process=image/resize,m_lfit,w_192,h_192`" mode="aspectFill"></image>
<view class="fivecontent_item_boxitemleft flex-colum-start">
<view class="fivecontent_item_boxitemleftone flex-between"
style="display: flex;justify-content: space-between;align-items: center;">

View File

@@ -40,8 +40,13 @@
size: 10, //页容量
status: 'loadmore',
},
userId:null
}
},
onLoad() {
this.userId = uni.cache.get('userInfo').id
// this.paygetShopByMember()
},
onShow() {
this.paygetShopByMember()
},

View File

@@ -220,6 +220,7 @@
},
onLoad(e) {
// console.log(e, 140)
this.$store.dispatch("set_shopid"); //获取shapid
let res = JSON.parse(e.tableId)
this.listinfo.detailList = res
this.listinfo.amount = e.amount // 算完了的价格
@@ -266,10 +267,9 @@
}
},
async getAount() {
console.log(uni.cache.get('userInfo'), '余额中userId不显示打印')
let res = await this.api.shopUserInfo({
// shopId:店铺ID
"shopId": uni.cache.get('shopUser'),
"shopId": this.$store.state.shopId,
"userId": uni.cache.get('userInfo').id,
})
if (res.code == 0) {
@@ -342,7 +342,7 @@
"isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1 使用, 0 不使用),
"isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1 购买, 0 不够买)
"productId": '', //商品id
"shopId": uni.cache.get('shopUser'),
"shopId": this.$store.state.shopId,
"userId": uni.cache.get('userInfo').id,
// tableId:uni.cache.get('tableCode')
}
@@ -365,7 +365,7 @@
"isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1 使用, 0 不使用),
"isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1 购买, 0 不够买)
"productId": '', //商品id
"shopId": uni.cache.get('shopUser'),
"shopId": this.$store.state.shopId,
"userId": uni.cache.get('userInfo').id,
// tableId:uni.cache.get('tableCode')
}

View File

@@ -234,13 +234,15 @@
this.ispws = false
},
onLoad(e) {
this.listinfo = JSON.parse(e.tablelist)
// 获取余额
this.getAount()
// this.getAount()
// 获取用户信息,判断是否设置支付密码
this.getuserinfo()
},
onShow() {
// this.$store.dispatch("set_shopid"); //获取shapid
this.getAount()
this.getuserinfo()
},
@@ -267,10 +269,9 @@
}
},
async getAount() {
console.log(uni.cache.get('userInfo'), '余额中userId不显示打印')
let res = await this.api.shopUserInfo({
// shopId:店铺ID
"shopId": uni.cache.get('shopUser'),
"shopId": this.$store.state.shopId,
"userId": uni.cache.get('userInfo').id,
})
if (res.code == 0) {
@@ -343,7 +344,7 @@
"isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1 使用, 0 不使用),
"isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1 购买, 0 不够买)
"productId": '', //商品id
"shopId": uni.cache.get('shopUser'),
"shopId": this.$store.state.shopId,
"userId": uni.cache.get('userInfo').id,
// tableId:uni.cache.get('tableCode')
}
@@ -366,7 +367,7 @@
"isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1 使用, 0 不使用),
"isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1 购买, 0 不够买)
"productId": '', //商品id
"shopId": uni.cache.get('shopUser'),
"shopId": this.$store.state.shopId,
"userId": uni.cache.get('userInfo').id,
// tableId:uni.cache.get('tableCode')
}

View File

@@ -60,7 +60,7 @@
</view>
<view class="shop-item" v-for="(item1,index1) in item.products" :key="item1.id">
<view class="cover" style="width:180rpx; height: 180rpx;">
<c-image :src="item1.coverImg" width="180" height="180"></c-image>
<c-image :src="`${item1.coverImg}?x-oss-process=image/resize,m_lfit,w_180,h_180`" width="180" height="180"></c-image>
</view>
<view class="info " style="display: flex;flex-direction: column;justify-content: center;">
<view class="name">
@@ -272,7 +272,7 @@
}
this.countScrollTitle(e.scrollTop);
},
onLoad(e) {
onLoad(e) {
if (e.q) {
let tableCode = this.getQueryString(decodeURIComponent(e.q), 'code')
uni.cache.set('tableCode', tableCode)
@@ -280,7 +280,7 @@
}
if (!uni.cache.get('token') && uni.cache.get('tableCode')) {
uni.reLaunch({
url: '/pages/login/login?type=' + 0
url: '/pages/login/login?types=' + 0
});
}
uni.$on('message', this.getMessage)
@@ -292,10 +292,16 @@
this.socketSendMsg({ //定义socket数据传参
"type": "close", //“addcart:添加购物车create0rder:生成订单clearCart:庆康购物车”,
})
console.log(this.socketTicket, '关闭长连接')
this.socketTicket.Close()
uni.$off('message')
},
onShow() {
// console.log(this.socketTicket,'进入页面')
// if (this.socketTicket) {
// this.socketTicket.Close()
// uni.$off('message')
// }
// uni.onNetworkStatusChange((res) => { //监听网络状态变化
// if (!res.isConnected) {
// // 检查网络是否连接
@@ -305,6 +311,7 @@
// }
// });
setTimeout(() => {
console.log('调试1')
if (uni.cache.get('token') && uni.cache.get('tableCode')) {
this.productqueryShopIdByTableCode() //获取shop User id
}
@@ -388,14 +395,16 @@
case 'addcart':
this.cartLists = msg
if (msg.data.length != 0) {
let nums = 0
msg.data.forEach((item, index, arr) => { //初始化skuidname的数据 选择第一个
if (item.skuId == this.skuidsearch) {
this.$set(this, 'amountcartNumber', item.number)
}
nums = item.number
}
// else {
// this.$set(this, 'amountcartNumber', 0)
// }
})
this.$set(this, 'amountcartNumber', nums)
} else {
this.$set(this, 'amountcartNumber', 0)
}
@@ -528,7 +537,7 @@
return res
})
this.specifications.tagSnap.forEach((val, index, arr) => { //初始化skuidname的数据 选择第一个
console.log(val.children[0],'skuidnam是否为空1')
console.log(val.children[0], 'skuidnam是否为空1')
this.skuidname.push(val.children[0])
})
try {
@@ -541,7 +550,7 @@
}
},
async morloe(e, index, index1, item) {
console.log(index,'skuidnam是否为空2')
console.log(index, 'skuidnam是否为空2')
this.specifications.tagSnap[index]['start'] = index1
this.skuidname.splice(index, 1, e) //替换skuidname的数据
this.hodgepodge(item, 2)
@@ -605,6 +614,7 @@
"shopId": uni.cache.get('shopUser'),
"userId": uni.cache.get('userInfo').id,
}
this.$store.dispatch("set_shopid"); //获取shapid
uni.$u.debounce(this.socketSendMsg(data), 500)
},
orderfoodindex() {

View File

@@ -109,6 +109,7 @@
payPassword
},
onLoad(e) {
this.$store.dispatch("set_shopid"); //获取shapid
this.getInfo(e.id)
this.orderIds = e.id
this.amount = uni.cache.get('userInfo').amount
@@ -131,7 +132,7 @@
async getAount() {
let res = await this.api.shopUserInfo({
// shopId:店铺ID
"shopId": this.info.shopId,
"shopId": this.$store.state.shopId,
"userId": uni.cache.get('userInfo').id
})
if (res.code == 0) {

View File

@@ -18,7 +18,7 @@ const store = new Vuex.Store({
bottompadding: "",
heightBar: ''
},
shopId: null
},
getters: {
is_login(state) {
@@ -35,8 +35,12 @@ const store = new Vuex.Store({
//二次修改后的值 或者过滤的
return state.info;
},
},
mutations: {
SET_SHOPID(state, data) {
state.shopId = data;
},
SET_STATUS_BAR(state, data) {
state.BarHeight.statusBar = data;
},
@@ -57,7 +61,16 @@ const store = new Vuex.Store({
},
},
actions: {
set_shopid: async ({
commit
}, data) => {
let res = await Api.productqueryShopIdByTableCode({
code: uni.cache.get('tableCode')
})
if (res.code == 0) {
commit('SET_SHOPID', res.data)
}
},
HeightActions({
commit
}) {
@@ -95,8 +108,8 @@ const store = new Vuex.Store({
// #ifdef APP-PLUS
console.log('app-plus', e)
statusBar = e.statusBarHeight
heightBar = e.statusBarHeight
customBar = e.statusBarHeight
heightBar = e.statusBarHeight
customBar = e.statusBarHeight
bottomPadding = (e.screenHeight - e.safeArea.bottom)
// customBar = 0
// #endif