fix qr_code, removed some features not implemented, added pulldown refresh logic for first page and merchant page
This commit is contained in:
parent
8f99a2b8b1
commit
d3ac0573bf
@ -116,7 +116,7 @@
|
|||||||
<image src="https://static.hshuishang.com/property-img-file/localLife_detail_Frame.png" mode="" />
|
<image src="https://static.hshuishang.com/property-img-file/localLife_detail_Frame.png" mode="" />
|
||||||
<view>电话</view>
|
<view>电话</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="left_label" @click="handleDiscussClick">
|
<view v-if="isShow" class="left_label" @click="handleDiscussClick">
|
||||||
<image src="https://static.hshuishang.com/property-img-file/localLife_shopList_Group_1334.png" mode="" />
|
<image src="https://static.hshuishang.com/property-img-file/localLife_shopList_Group_1334.png" mode="" />
|
||||||
<view>点评</view>
|
<view>点评</view>
|
||||||
</view>
|
</view>
|
||||||
@ -185,9 +185,25 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const params = {
|
let id;
|
||||||
id: Number(uni.getStorageSync("merchantInfo").id)
|
if (options.scene) {
|
||||||
}
|
const scene = decodeURIComponent(options.scene);
|
||||||
|
function getQueryParam(str, name) {
|
||||||
|
const reg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`);
|
||||||
|
const match = str.match(reg);
|
||||||
|
return match ? decodeURIComponent(match[2]) : null;
|
||||||
|
}
|
||||||
|
const idStr = getQueryParam(scene, 'id'); // 得到 "22"
|
||||||
|
if (idStr) {
|
||||||
|
id = Number(idStr); // 得到 22
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
id = Number(uni.getStorageSync("merchantInfo").id)
|
||||||
|
}
|
||||||
|
console.log('scene:',options.scene,id)
|
||||||
|
const params = {
|
||||||
|
id: id
|
||||||
|
}
|
||||||
request(apiArr.getMerchantInfo, "POST", params).then(res => {
|
request(apiArr.getMerchantInfo, "POST", params).then(res => {
|
||||||
this.info = res
|
this.info = res
|
||||||
uni.setStorageSync('merchantInfo', res)
|
uni.setStorageSync('merchantInfo', res)
|
||||||
@ -197,7 +213,7 @@ export default {
|
|||||||
this.flag = false
|
this.flag = false
|
||||||
this.commentList = []
|
this.commentList = []
|
||||||
this.getCommentList()
|
this.getCommentList()
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if (this.info.id) {
|
if (this.info.id) {
|
||||||
|
|||||||
@ -83,7 +83,7 @@
|
|||||||
买单返积分
|
买单返积分
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="merchantItem_right_con_right" @click="toJump(item)">
|
<view v-if="item.quick_purchase_enabled==1" class="merchantItem_right_con_right" @click.stop="toJump(item)">
|
||||||
<image src="https://static.hshuishang.com/property-img-file/local_review.png"
|
<image src="https://static.hshuishang.com/property-img-file/local_review.png"
|
||||||
mode="aspectFill"></image>
|
mode="aspectFill"></image>
|
||||||
点评
|
点评
|
||||||
@ -119,6 +119,7 @@
|
|||||||
import {
|
import {
|
||||||
request,
|
request,
|
||||||
picUrl,
|
picUrl,
|
||||||
|
RequestUrl,
|
||||||
uniqueByField,
|
uniqueByField,
|
||||||
menuButtonInfo,
|
menuButtonInfo,
|
||||||
calculateDistance,
|
calculateDistance,
|
||||||
@ -155,8 +156,20 @@ export default {
|
|||||||
console.log(this.address);
|
console.log(this.address);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.page_num = 1;
|
||||||
|
this.merchatList = [];
|
||||||
|
this.flag = false;
|
||||||
|
this.searchText = '';
|
||||||
|
this.getCateList();
|
||||||
|
this.getMechantList().then(() => {
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.flag) {
|
if (this.flag) {
|
||||||
|
this.page_num += 1;
|
||||||
this.getMechantList();
|
this.getMechantList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarBackgroundColor": "#FFF",
|
"navigationBarBackgroundColor": "#FFF",
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"nav-footer": "/components/nav/nav"
|
"nav-footer": "/components/nav/nav"
|
||||||
}
|
}
|
||||||
@ -602,7 +603,8 @@
|
|||||||
"path": "index/index",
|
"path": "index/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "湖畔好店",
|
"navigationBarTitleText": "湖畔好店",
|
||||||
"navigationBarBackgroundColor": "#fff"
|
"navigationBarBackgroundColor": "#fff",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1197,6 +1197,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.bottomList = [];
|
||||||
|
this.bottomPageNum = 1;
|
||||||
|
this.flag = false;
|
||||||
|
this.init();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
},
|
||||||
|
|
||||||
async onReachBottom() {
|
async onReachBottom() {
|
||||||
if (this.flag) {
|
if (this.flag) {
|
||||||
const res = await this.getHomeBottom();
|
const res = await this.getHomeBottom();
|
||||||
|
|||||||
@ -71,11 +71,11 @@
|
|||||||
src="https://static.hshuishang.com/property-img-file/page_user_Group_1557.png" />
|
src="https://static.hshuishang.com/property-img-file/page_user_Group_1557.png" />
|
||||||
<text class="device-title title-item">我的工单</text>
|
<text class="device-title title-item">我的工单</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="item_device" @click="handleMeApplyClick">
|
<!--view class="item_device" @click="handleMeApplyClick">
|
||||||
<image class="icon-img"
|
<image class="icon-img"
|
||||||
src="https://static.hshuishang.com/property-img-file/page_user_Group_1558.png" />
|
src="https://static.hshuishang.com/property-img-file/page_user_Group_1558.png" />
|
||||||
<text class="device-title title-item">我的管家</text>
|
<text class="device-title title-item">我的管家</text>
|
||||||
</view>
|
</view-->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -92,7 +92,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="main margin20">
|
<!--view class="main margin20">
|
||||||
<view class="main_title">到家服务</view>
|
<view class="main_title">到家服务</view>
|
||||||
<view class="item1 padding_bottom0">
|
<view class="item1 padding_bottom0">
|
||||||
<u-grid col="4" :border="false">
|
<u-grid col="4" :border="false">
|
||||||
@ -102,7 +102,7 @@
|
|||||||
</u-grid-item>
|
</u-grid-item>
|
||||||
</u-grid>
|
</u-grid>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view-->
|
||||||
<view class="main margin20">
|
<view class="main margin20">
|
||||||
<view class="main_title">门店服务</view>
|
<view class="main_title">门店服务</view>
|
||||||
<view class="item1 padding_bottom0">
|
<view class="item1 padding_bottom0">
|
||||||
@ -169,16 +169,16 @@ export default {
|
|||||||
name: "团购订单",
|
name: "团购订单",
|
||||||
url: "/packages/myOrders/groupOrders/index",
|
url: "/packages/myOrders/groupOrders/index",
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
image: "https://static.hshuishang.com/property-img-file/page_user_Group_1565.png",
|
// image: "https://static.hshuishang.com/property-img-file/page_user_Group_1565.png",
|
||||||
name: "我的收藏",
|
// name: "我的收藏",
|
||||||
url: "",
|
// url: "",
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
image: "https://static.hshuishang.com/property-img-file/page_user_Group_1566.png",
|
// image: "https://static.hshuishang.com/property-img-file/page_user_Group_1566.png",
|
||||||
name: "售后服务",
|
// name: "售后服务",
|
||||||
url: "",
|
// url: "",
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
image: "https://static.hshuishang.com/property-img-file/page_user_Group_1563.png",
|
image: "https://static.hshuishang.com/property-img-file/page_user_Group_1563.png",
|
||||||
name: "收货地址",
|
name: "收货地址",
|
||||||
@ -209,17 +209,17 @@ export default {
|
|||||||
shopList: [{
|
shopList: [{
|
||||||
image: "https://static.hshuishang.com/property-img-file/page_user_Group_1580.png",
|
image: "https://static.hshuishang.com/property-img-file/page_user_Group_1580.png",
|
||||||
name: "附近门店",
|
name: "附近门店",
|
||||||
url: "",
|
url: "/packages/localLife/index/index",
|
||||||
},
|
|
||||||
{
|
|
||||||
image: "https://static.hshuishang.com/property-img-file/page_user_Group_1581.png",
|
|
||||||
name: "服务券",
|
|
||||||
url: "",
|
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// image: "https://static.hshuishang.com/property-img-file/page_user_Group_1581.png",
|
||||||
|
// name: "服务券",
|
||||||
|
// url: "",
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
image: "https://static.hshuishang.com/property-img-file/page_user_Group_1582.png",
|
image: "https://static.hshuishang.com/property-img-file/page_user_Group_1582.png",
|
||||||
name: "支付记录",
|
name: "支付记录",
|
||||||
url: "",
|
url: "/packages/localLife/payInfo/index",
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
shopManagementList: [
|
shopManagementList: [
|
||||||
|
|||||||
@ -16,11 +16,6 @@ const environments = {
|
|||||||
|
|
||||||
// 判断当前环境
|
// 判断当前环境
|
||||||
const getCurrentEnvironment = () => {
|
const getCurrentEnvironment = () => {
|
||||||
// 1. 优先通过NODE_ENV判断
|
|
||||||
if (process && process.env && process.env.NODE_ENV) {
|
|
||||||
return process.env.NODE_ENV;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. 微信小程序环境判断
|
// 2. 微信小程序环境判断
|
||||||
if (typeof wx !== "undefined" && wx.getAccountInfoSync) {
|
if (typeof wx !== "undefined" && wx.getAccountInfoSync) {
|
||||||
try {
|
try {
|
||||||
@ -30,7 +25,7 @@ const getCurrentEnvironment = () => {
|
|||||||
if (envVersion === "release") {
|
if (envVersion === "release") {
|
||||||
return "production"; // 正式版
|
return "production"; // 正式版
|
||||||
} else if (envVersion === "trial") {
|
} else if (envVersion === "trial") {
|
||||||
return "development"; // 体验版
|
return "production"; // 体验版
|
||||||
} else if (envVersion === "develop") {
|
} else if (envVersion === "develop") {
|
||||||
return "development"; // 开发版
|
return "development"; // 开发版
|
||||||
}
|
}
|
||||||
@ -39,6 +34,11 @@ const getCurrentEnvironment = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 1. 优先通过NODE_ENV判断
|
||||||
|
if (process && process.env && process.env.NODE_ENV) {
|
||||||
|
return process.env.NODE_ENV;
|
||||||
|
}
|
||||||
|
|
||||||
// 3. 通过全局配置判断(例如Vercel等平台的环境变量)
|
// 3. 通过全局配置判断(例如Vercel等平台的环境变量)
|
||||||
if (typeof global !== "undefined" && global.env) {
|
if (typeof global !== "undefined" && global.env) {
|
||||||
return global.env;
|
return global.env;
|
||||||
@ -54,7 +54,7 @@ const getCurrentEnvironment = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 获取当前环境配置
|
// 获取当前环境配置
|
||||||
const currentEnv = getCurrentEnvironment();
|
const currentEnv = "production";//getCurrentEnvironment();
|
||||||
const envConfig = environments[currentEnv] || environments.production;
|
const envConfig = environments[currentEnv] || environments.production;
|
||||||
|
|
||||||
export const RequsetUrl = envConfig.apiUrl; // 请求地址前缀
|
export const RequsetUrl = envConfig.apiUrl; // 请求地址前缀
|
||||||
@ -227,7 +227,7 @@ export const request = (
|
|||||||
}
|
}
|
||||||
resolve(res.data.data); // 请求成功
|
resolve(res.data.data); // 请求成功
|
||||||
} else {
|
} else {
|
||||||
console.log("走到这列");
|
console.log("走到这列",RequsetUrl, url,res.header,res.data,res.profile);
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: res.data.msg || "请求失败",
|
// title: res.data.msg || "请求失败",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user