Merge branch 'dev' into test

This commit is contained in:
lifizer
2024-07-05 17:25:38 +08:00
81 changed files with 3408 additions and 1885 deletions
+2
View File
@@ -1,7 +1,9 @@
<script> <script>
import { clearAllInterval } from '@/utils/util'
export default { export default {
onLaunch: function () { onLaunch: function () {
console.log('App Launch') console.log('App Launch')
clearAllInterval()
}, },
onShow: function () { onShow: function () {
console.log('App Show') console.log('App Show')
+9 -1
View File
@@ -219,4 +219,12 @@ export function setTopHotelNew(data) {
return request.post("/api/hotelNews/setIsTop", data, { return request.post("/api/hotelNews/setIsTop", data, {
login: true login: true
}); });
} }
/**
* 店铺转发分享背景图片
* @param id 店铺ID int
* */
export function getHotelShareBackgroundImage(id) {
return request.get("/api/hotelMain/shareImage/" + id, {}, {login: true})
}
+7
View File
@@ -28,4 +28,11 @@ export function takePrize(lotteryRecordId){
* */ * */
export function getLogs(page = 1, limit = 10) { export function getLogs(page = 1, limit = 10) {
return request.get('/lottery/dice/records',{page,limit}) return request.get('/lottery/dice/records',{page,limit})
}
/**
* 抽奖活动分享
* */
export function getLotteryShareInfo() {
return request.get('/lottery/shareImage')
} }
+4
View File
@@ -207,4 +207,8 @@ export function getShareImage() {
export function getXiaoZhi() { export function getXiaoZhi() {
return request.get("/appAdvertising", {}, {login: false}) return request.get("/appAdvertising", {}, {login: false})
}
export function pushSystemStatic(data) {
return request.post("/systemStats/push", data, { login: false })
} }
+14
View File
@@ -273,6 +273,13 @@ export function postAddress(data) {
return request.post("/address/edit", data); return request.post("/address/edit", data);
} }
/*
* 自动识别收货地址
* */
export function analysisAddress(data) {
return request.post("/address/analysis", data);
}
/* /*
* 获取收藏产品 * 获取收藏产品
* */ * */
@@ -554,3 +561,10 @@ export function getUserPointInfo(param) {
export function getUserPointBill(param) { export function getUserPointBill(param) {
return request.get('/user/points/bill', param, { login: true }) return request.get('/user/points/bill', param, { login: true })
} }
/*
* 用户分销说明
*/
export function getUserSpreadRule(param) {
return request.get('/userSpreadRule', param, { login: false })
}
+4
View File
@@ -198,6 +198,10 @@
border-left: 2rpx solid #D2D2D2; border-left: 2rpx solid #D2D2D2;
.value-cont { .value-cont {
padding: 16rpx; padding: 16rpx;
word-wrap: break-word;
word-break: break-all;
word-break: normal;
white-space: initial;
} }
} }
.btn { .btn {
+8 -2
View File
@@ -1,6 +1,6 @@
<template> <template>
<view @tap.stop="open"> <view class="address-text-wrapper" @tap.stop="open">
<text class="uni-input">{{ value }}</text> <view class="uni-input one-t address-text">{{ value }}</view>
<uni-popup ref="popup" type="bottom" safe-area> <uni-popup ref="popup" type="bottom" safe-area>
<view class="cityselect"> <view class="cityselect">
<view class="cityselect-header"> <view class="cityselect-header">
@@ -220,6 +220,12 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
.address-text-wrapper {
width: 100%;
.address-text {
width: 100%;
}
}
.cityselect { .cityselect {
width: 100%; width: 100%;
height: 75%; height: 75%;
+2
View File
@@ -22,3 +22,5 @@ export const VUE_APP_RESOURCES_URL = "https://wxapp.xdd618.com/api/file/pic"
export const STATIC_RESOURCE_URL = "https://resource.xdd618.com/image" export const STATIC_RESOURCE_URL = "https://resource.xdd618.com/image"
export const WX_LIVE_APPID = "wx2b03c6e691cd7370"; export const WX_LIVE_APPID = "wx2b03c6e691cd7370";
export const pageViewDataCacheKey = 'pageViewDataCacheKey'
+5
View File
@@ -0,0 +1,5 @@
import { getPageViewDataToLocalCache } from '@/utils/util'
export const pageToWatchData = Object.assign({
'appIndex': []
}, getPageViewDataToLocalCache())
+22 -17
View File
@@ -49,25 +49,30 @@ export function takeOrderHandle(orderId) {
export function delOrderHandle(orderId) { export function delOrderHandle(orderId) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
dialog.confirm({ uni.showModal({
mes: "确认删除该订单?", title: '提示',
opts() { content: '确认删除该订单?',
delOrder(orderId) success(res) {
.then(res => { if (res.confirm) {
delOrder(orderId).then(res => {
uni.showToast({ uni.showToast({
title: '删除成功', icon: 'success', duration: 2000 title: '删除成功',
}); icon: 'success',
resolve(res); duration: 2000
})
resolve(res)
}).catch(err => {
uni.showToast({
title: '删除失败',
icon: 'none',
duration: 2000
})
reject(err)
}) })
.catch(err => { }
uni.showToast({ }
title: '删除失败', icon: 'none', duration: 2000 })
}); })
reject(err);
});
}
});
});
} }
export function payOrderHandle(orderId, type, from) { export function payOrderHandle(orderId, type, from) {
+3 -1
View File
@@ -16,6 +16,7 @@ import {
} from "@/config"; } from "@/config";
import uView from "uview-ui"; import uView from "uview-ui";
import GooSkeleton from '@/components/GooSkeleton/index.vue' import GooSkeleton from '@/components/GooSkeleton/index.vue'
import { pageToWatchData } from '@/config/page'
Vue.use(uView) Vue.use(uView)
Vue.component('GooSkeleton', GooSkeleton) Vue.component('GooSkeleton', GooSkeleton)
@@ -32,7 +33,8 @@ Vue.prototype.$VUE_APP_RESOURCES_URL = VUE_APP_RESOURCES_URL
Vue.prototype.$STATIC_RESOURCE_URL = STATIC_RESOURCE_URL Vue.prototype.$STATIC_RESOURCE_URL = STATIC_RESOURCE_URL
Vue.prototype.$VUE_APP_API_URL = VUE_APP_API_URL Vue.prototype.$VUE_APP_API_URL = VUE_APP_API_URL
Vue.prototype.$WX_LIVE_APPID = WX_LIVE_APPID Vue.prototype.$WX_LIVE_APPID = WX_LIVE_APPID
Vue.prototype.$global = global; Vue.prototype.$global = global
Vue.prototype.$pageToWatchData = pageToWatchData
Vue.prototype.$validator = function (rule) { Vue.prototype.$validator = function (rule) {
return new schema(rule); return new schema(rule);
+36
View File
@@ -0,0 +1,36 @@
import {
pageToWatchShowCount,
pageToWatchShowTimer,
getCurrDateTime,
TimeDifference
} from '@/utils/util'
export const pageListenMixins = {
data(){
return {
pageViewDateTime: ''
}
},
onShow() {
this.pageViewDateTime = getCurrDateTime()
this.pageToWatchShowCount(this.pageKeyId)
},
onUnload() {
this.pageToHideHandle()
},
methods: {
pageToWatchShowCount,
pageToWatchShowTimer,
pageToHideHandle() {
const visitTime = TimeDifference(this.pageViewDateTime, getCurrDateTime())
if (visitTime > 0) {
this.pageToWatchShowTimer(this.pageKeyId, {
statsName: this.pageKeyId,
statsTime: this.pageViewDateTime,
visitTime
})
}
this.pageViewDateTime = ''
console.log('清除页面监听-----%s', this.pageKeyId)
}
}
}
+6
View File
@@ -546,6 +546,12 @@
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{
"path": "views/heritageGoodAndVideo",
"style": {
"navigationBarTitleText": ""
}
},
{ {
"path": "views/homestay", "path": "views/homestay",
"style": { "style": {
@@ -130,7 +130,7 @@ export default {
// this.videoContext = uni.createVideoContext('myVideo'); // this.videoContext = uni.createVideoContext('myVideo');
// this.videoContext.requestFullScreen(); // this.videoContext.requestFullScreen();
this.$yrouter.push('/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl='+video.video); this.$yrouter.push('/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl='+video.video + '&id=' + video.id);
}, },
liveClick:function(video){ liveClick:function(video){
var liveAppId = this.$WX_LIVE_APPID; var liveAppId = this.$WX_LIVE_APPID;
@@ -4,16 +4,18 @@
</view> </view>
</template> </template>
<script> <script>
import uniPopup from '@/components/uni-popup/uni-popup.vue'; import uniPopup from '@/components/uni-popup/uni-popup.vue'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components:{ components:{
uniPopup uniPopup
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
curPlayVideoUrl:'', curPlayVideoUrl:'',
isVideoPopupShow:false isVideoPopupShow:false,
pageKeyId: ''
} }
}, },
onReady: function(res) { onReady: function(res) {
@@ -21,10 +23,9 @@ export default {
this.videoContext.requestFullScreen(); this.videoContext.requestFullScreen();
}, },
onLoad:function(e){ onLoad:function(e){
this.curPlayVideoUrl = e.videoUrl
this.curPlayVideoUrl = e.videoUrl; const id = options.id
//this.$refs.popup.open(); this.pageKeyId = `findVideo_videoId_${id}`
}, },
methods: { methods: {
videoErrorCallback: function(e) { videoErrorCallback: function(e) {
+27 -29
View File
@@ -32,71 +32,69 @@
</template> </template>
<script> <script>
import {getStoreVideoType, getArticleList} from "@/api/public"; import {getStoreVideoType, getArticleList} from '@/api/public'
import {getVideoList} from "@/api/user"; import {getVideoList} from '@/api/user'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
typeList: [{"label": "全部", "value": ""}], typeList: [{'label': '全部', 'value': ''}],
type: "", type: '',
page: 1, page: 1,
limit: 10, limit: 10,
keyword: "", keyword: '',
list: [], list: [],
isWait: false isWait: false,
pageKeyId: Object.freeze('findVideoList')
} }
}, },
onLoad() { onLoad() {
this.getType(); this.getType()
this.fetchList(); this.fetchList()
}, },
onReachBottom() { onReachBottom() {
this.page++; this.page++
this.fetchList(); this.fetchList()
}, },
methods: { methods: {
getType() { getType() {
getStoreVideoType().then(({data}) => { getStoreVideoType().then(({data}) => {
if (data.length > 0) { if (data.length > 0) {
data.forEach(item => { data.forEach(item => {
this.typeList.push(item); this.typeList.push(item)
}) })
} }
}); })
}, },
changeType(item) { changeType(item) {
this.type = item.value; this.type = item.value
this.page = 1; this.page = 1
this.list = []; this.list = []
this.fetchList(); this.fetchList()
}, },
fetchList() { fetchList() {
if (this.isWait) return; if (this.isWait) return
this.isWait = true; this.isWait = true
const params = {
let params = {
type: this.type, type: this.type,
page: this.page, page: this.page,
limit: this.limit limit: this.limit
}; }
getVideoList(params).then(res => { getVideoList(params).then(res => {
if (res.status === 200) { if (res.status === 200) {
for (let i = 0; i < res.data.length; i++) { for (let i = 0; i < res.data.length; i++) {
res.data[i].hide = true; res.data[i].hide = true
this.list.push(res.data[i]) this.list.push(res.data[i])
} }
} }
this.isWait = false; this.isWait = false
}); })
}, },
goDetail(item) { goDetail(item) {
this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video); this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video + '&id=' + item.id)
} }
} }
} }
+74 -18
View File
@@ -40,12 +40,55 @@
<view class="dialog-mask" v-if="showFillOut"> <view class="dialog-mask" v-if="showFillOut">
<view class="dialog-fill flex flex-col ai-center"> <view class="dialog-fill flex flex-col ai-center">
<view class="title bold">请完善您的头像和昵称</view> <view class="title bold">请完善您的信息</view>
<button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"> <button
<image class="avatar" :src="avatarUrl"></image> class="avatar-wrapper"
open-type="chooseAvatar"
@chooseavatar="onChooseAvatar"
>
<image
:src="avatarUrl"
class="avatar"
/>
</button> </button>
<input type="nickname" class="input-wrapper" placeholder="请输入昵称" @input="inputName" @confirm="inputName" <input
@blur="inputName"/> type="nickname"
maxlength="12"
class="input-wrapper"
placeholder="请输入昵称"
@input="inputName"
@confirm="inputName"
@blur="inputName"
/>
<view class="input-wrapper">
<picker
:value="form.birthday"
mode="date"
class="picker"
@change="birthdayChange"
>
{{ form.birthday || '请选择出生日期' }}
</picker>
</view>
<view class="gender-row">
性别
<u-radio-group
v-model="form.gender"
placement="row"
>
<u-radio
:name="1"
:customStyle="{marginRight: '16px'}"
active-color="#C41617"
label="男"
/>
<u-radio
:name="2"
active-color="#C41617"
label="女"
/>
</u-radio-group>
</view>
<view class="btn-submit" @click="onSubmit">确认</view> <view class="btn-submit" @click="onSubmit">确认</view>
</view> </view>
</view> </view>
@@ -61,10 +104,8 @@
import {mapActions, mapMutations, mapState} from 'vuex' import {mapActions, mapMutations, mapState} from 'vuex'
import cookie from '@/utils/store/cookie' import cookie from '@/utils/store/cookie'
import {login, uploadImage} from '@/utils' import {login, uploadImage} from '@/utils'
import {getAgree} from "@/api/public"; import {getAgree} from "@/api/public"
import {postUserEdit} from "@/api/user"; import {postUserEdit} from "@/api/user"
const defaultAvatarUrl = "/20230506100714762257.png"
export default { export default {
data() { data() {
@@ -75,10 +116,13 @@ export default {
agreeInfo: {}, agreeInfo: {},
isAgree: false, isAgree: false,
show: false, show: false,
showFillOut: false, showFillOut: false,
nickname: "", nickname: '',
avatarUrl: this.$VUE_APP_RESOURCES_URL + defaultAvatarUrl, avatarUrl: this.$VUE_APP_RESOURCES_URL + '/20230506100714762257.png',
form: {
gender: '',
birthday: ''
}
} }
}, },
computed: { computed: {
@@ -174,6 +218,10 @@ export default {
inputName(e) { inputName(e) {
this.nickname = e.detail.value; this.nickname = e.detail.value;
}, },
birthdayChange(e) {
const value = e.detail.value
this.form.birthday = value
},
onSubmit() { onSubmit() {
let that = this; let that = this;
@@ -205,9 +253,11 @@ export default {
}, },
saveUserInfo() { saveUserInfo() {
let param = { const param = {
nickname: this.nickname, nickname: this.nickname,
avatar: this.avatarUrl avatar: this.avatarUrl,
gender: this.form.gender || 0,
birthday: this.form.birthday || ''
} }
postUserEdit(param).then(res => { postUserEdit(param).then(res => {
if (res.status === 200) { if (res.status === 200) {
@@ -336,7 +386,6 @@ export default {
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
width: 516rpx; width: 516rpx;
height: 576rpx;
border-radius: 24rpx; border-radius: 24rpx;
background: #fff; background: #fff;
@@ -374,13 +423,20 @@ export default {
font-size: 32rpx; font-size: 32rpx;
text-align: center; text-align: center;
} }
.gender-row {
display: flex;
align-items: center;
margin-top: 32rpx;
}
.picker {
text-align: center;
line-height: 72rpx;
}
.btn-submit { .btn-submit {
position: absolute;
bottom: 0;
left: 0;
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
margin: 32rpx 0 0 0;
box-sizing: border-box; box-sizing: border-box;
border-top: 2rpx solid #E0E0E0; border-top: 2rpx solid #E0E0E0;
color: #3A87FC; color: #3A87FC;
+41 -15
View File
@@ -29,7 +29,7 @@
class="group-item" class="group-item"
> >
<view class="flex jc-between"> <view class="flex jc-between">
<view class="flex ai-center"> <view class="flex ai-center mer-left">
<CheckboxIcon <CheckboxIcon
:default-state="item['state']" :default-state="item['state']"
:mark="[index]" :mark="[index]"
@@ -41,11 +41,10 @@
class="store-cover" class="store-cover"
mode="scaleToFill" mode="scaleToFill"
/> />
<view style="color:#333333;font-size: 30rpx">{{ item['merName'] }}</view> <view class="mer-name">{{ item['merName'] }}</view>
</view> </view>
<view <view
class="flex ai-center" class="flex ai-center hotle-btn"
style="color:#E92727;font-size: 24rpx"
@click="navToStore(item['hotelId'])" @click="navToStore(item['hotelId'])"
> >
进店逛逛 进店逛逛
@@ -73,19 +72,19 @@
:src="good['productInfo']['attrInfo']['image']" :src="good['productInfo']['attrInfo']['image']"
class="good-cover flex-0" class="good-cover flex-0"
mode="scaleToFill" mode="scaleToFill"
@click="navToGood(good['productId'])" @click="navToGood(good)"
/> />
<image <image
v-else v-else
:src="good['productInfo']['image']" :src="good['productInfo']['image']"
mode="scaleToFill" mode="scaleToFill"
class="good-cover flex-0" class="good-cover flex-0"
@click="navToGood(good['productId'])" @click="navToGood(good)"
/> />
<view style="width: 100%"> <view style="width: 100%">
<view <view
class="one-t" class="one-t"
@click="navToGood(good['productId'])" @click="navToGood(good)"
>{{ good['productInfo']['storeName'] }}</view> >{{ good['productInfo']['storeName'] }}</view>
<view <view
class="sku ai-center" class="sku ai-center"
@@ -99,7 +98,7 @@
> >
<view <view
style="color:#E92727;font-size: 32rpx;" style="color:#E92727;font-size: 32rpx;"
@click="navToGood(good['productId'])" @click="navToGood(good)"
> >
<text class="bold" style="font-size: 24rpx">¥</text> <text class="bold" style="font-size: 24rpx">¥</text>
{{ good['truePrice'] }} {{ good['truePrice'] }}
@@ -225,10 +224,12 @@ import {
cartGoodChangeAttr cartGoodChangeAttr
} from '@/api/store' } from '@/api/store'
import CheckboxIcon from '@/components/CheckboxIcon.vue' import CheckboxIcon from '@/components/CheckboxIcon.vue'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: { components: {
CheckboxIcon CheckboxIcon
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
statusBarHeight: uni.getSystemInfoSync().statusBarHeight, statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
@@ -241,7 +242,8 @@ export default {
productAttr: [], productAttr: [],
productValueArr: [] productValueArr: []
}, },
showAttr: false showAttr: false,
pageKeyId: Object.freeze('landmarkGoodsIndex')
} }
}, },
computed: { computed: {
@@ -274,6 +276,9 @@ export default {
this.closeAttr() this.closeAttr()
this.getCart() this.getCart()
}, },
onHide() {
this.pageToHideHandle()
},
methods: { methods: {
async getCart() { async getCart() {
const res = await getCartGroup() const res = await getCartGroup()
@@ -342,11 +347,11 @@ export default {
const { type } = e const { type } = e
const value = good.cartNum + (type === 'plus' ? 1 : -1) const value = good.cartNum + (type === 'plus' ? 1 : -1)
const id = good.id const id = good.id
uni.showLoading() // uni.showLoading()
changeCartNum(id, value).then(res => { changeCartNum(id, value).then(res => {
const { success } = res const { success } = res
if (success) { if (success) {
uni.hideLoading() // uni.hideLoading()
this.$set(this.list[index].carts[gIndex], 'cartNum', value) this.$set(this.list[index].carts[gIndex], 'cartNum', value)
} }
}).catch(() => { }).catch(() => {
@@ -402,7 +407,7 @@ export default {
} }
const id = good.productInfo.id const id = good.productInfo.id
const unique = good.productInfo.attrInfo.unique const unique = good.productInfo.attrInfo.unique
uni.showLoading() // uni.showLoading()
getCartGoodAttr(id, unique).then(res => { getCartGoodAttr(id, unique).then(res => {
const { success, data } = res const { success, data } = res
if (success) { if (success) {
@@ -517,10 +522,17 @@ export default {
this.currGood = {} this.currGood = {}
this.showAttr = false this.showAttr = false
}, },
navToGood(id) { navToGood(good) {
const query = {
id: good.productId
}
if (good.seckillId) {
query.activityId = good.seckillId
query.from = 'kill'
}
this.$yrouter.push({ this.$yrouter.push({
path: '/pages/shop/GoodsCon/index', path: '/pages/shop/GoodsCon/index',
query: { id } query
}) })
}, },
submit() { submit() {
@@ -547,7 +559,7 @@ view {
.group-item { .group-item {
width: 710rpx; width: 710rpx;
margin: 12rpx 20rpx; margin: 12rpx 20rpx;
padding: 8rpx 8rpx 32rpx 20rpx; padding: 20rpx 8rpx 32rpx 20rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
@@ -557,6 +569,20 @@ view {
margin-right: 8rpx; margin-right: 8rpx;
border-radius: 50%; border-radius: 50%;
} }
.mer-left {
width: calc(100% - 140rpx);
}
.mer-name {
width: calc(100% - 104rpx);
color: #333;
font-size: 30rpx;
}
.hotle-btn {
justify-content: flex-end;
width: 140rpx;
color: #E92727;
font-size: 24rpx;
}
} }
.good-box { .good-box {
+60 -10
View File
@@ -141,28 +141,27 @@ import MescrollMixins from '@/mixins/mescroll-mixins.js'
import {fetchCity} from '@/api/wenwan' import {fetchCity} from '@/api/wenwan'
import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue' import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue'
import {getCurAddress, getLocation} from '@/utils/common.js' import {getCurAddress, getLocation} from '@/utils/common.js'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'ChoseCity', name: 'ChoseCity',
components: { components: {
MescrollBody MescrollBody
}, },
props: {},
mixins: [ mixins: [
MescrollMixins({ MescrollMixins({
getPageData(mescroll) { getPageData(mescroll) {
// 此时mescroll会携带page的参数:
// let pageNum = mescroll.num; // 页码, 默认从1开始
// let pageSize = mescroll.size; // 页长, 默认每页10条
mescroll.endSuccess(10) mescroll.endSuccess(10)
} }
}) }),
pageListenMixins
], ],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
upOption: { upOption: {
noMoreSize: 10, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5 // 如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
noMoreSize: 10,
auto: false, auto: false,
empty: { empty: {
tip: '暂无城市' tip: '暂无城市'
@@ -176,14 +175,38 @@ export default {
listCity: [], listCity: [],
navActive: 0, navActive: 0,
keyword: '', keyword: '',
// 0、特产;1、文玩;2、七彩云上;3、特色礼品;4、康养食材;5、千县名品;6、景点门票
type: null, type: null,
location: '', location: '',
banner: {}, banner: {},
recommendInfo: null // 推荐信息 // 推荐信息
recommendInfo: null,
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.type = Number(options.type) const type = Number(options.type)
this.type = type
switch(type) {
case 0:
this.pageKeyId = 'goodsIndex'
break
case 1:
this.pageKeyId = 'wenwanIndex'
break
case 3:
this.pageKeyId = 'customizedGiftIndex'
break
case 4:
this.pageKeyId = 'wellnessFoodIndex'
break
case 5:
this.pageKeyId = 'countyFamousIndex'
break
default:
this.pageKeyId = ''
break
}
this.location = options.city this.location = options.city
if (this.location === undefined) { if (this.location === undefined) {
this.getMapData() this.getMapData()
@@ -316,14 +339,41 @@ export default {
return return
} }
uni.navigateTo({ uni.navigateTo({
url: '/pagesInn/inn/innHome?id=' + id url: '/pagesInn/inn/innHome?id=' + id + '&from=' + this.getOptionsParams()
}) })
}, },
goToGoods(productId) { goToGoods(productId) {
if (!productId) { if (!productId) {
return return
} }
this.$global.navToGoods(productId) uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${productId}&from=${this.getOptionsParams()}`
})
},
getOptionsParams() {
// 0、特产;1、文玩;2、七彩云上;3、特色礼品;4、康养食材;5、千县名品;6、景点门票
let from = ''
switch(this.type) {
case 0:
from = 'techan'
break
case 1:
from = 'wenwan'
break
case 3:
from = 'gift'
break
case 4:
from = 'wellness'
break
case 5:
from = 'famous'
break
default:
from = ''
break
}
return from
}, },
bannerItemTapHandle(banner) { bannerItemTapHandle(banner) {
if (!banner) { if (!banner) {
+9 -4
View File
@@ -79,10 +79,12 @@
import { getHotelList, getHotelTypeList } from "@/api/inn.js" import { getHotelList, getHotelTypeList } from "@/api/inn.js"
import { getCurAddress, getLocation } from "@/utils/common" import { getCurAddress, getLocation } from "@/utils/common"
import FunHotelItem from './components/HotelItem' import FunHotelItem from './components/HotelItem'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: { components: {
FunHotelItem FunHotelItem
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -92,7 +94,8 @@ export default {
typeIndex: 0, typeIndex: 0,
cityName: '', cityName: '',
hotelList: [], hotelList: [],
isLoad: false isLoad: false,
pageKeyId: Object.freeze('findFunIndex')
} }
}, },
computed: { computed: {
@@ -111,9 +114,9 @@ export default {
this.fetchList() this.fetchList()
}, },
onLoad() { onLoad() {
this.getMapData()
getHotelTypeList().then(({data}) => { getHotelTypeList().then(({data}) => {
this.typeList = data; this.typeList = data
this.getMapData()
}) })
}, },
onShow() { onShow() {
@@ -121,6 +124,7 @@ export default {
if (memCityName.length) { if (memCityName.length) {
this.cityName = memCityName this.cityName = memCityName
uni.removeStorageSync('cityName') uni.removeStorageSync('cityName')
this.name = ''
this.search() this.search()
} }
}, },
@@ -132,7 +136,7 @@ export default {
}, },
goInnDetail(item) { goInnDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pagesInn/inn/innHome?id=${item.id}` url: `/pagesInn/inn/innHome?id=${item.id}&from=fun`
}) })
}, },
async getMapData() { async getMapData() {
@@ -147,6 +151,7 @@ export default {
tapType(index) { tapType(index) {
if (this.typeIndex === index) return if (this.typeIndex === index) return
this.typeIndex = index this.typeIndex = index
this.name = ''
this.search() this.search()
}, },
search() { search() {
+174 -196
View File
@@ -191,7 +191,7 @@
<view class="item flex" v-for="(item,index) in bastList" :key="index" slot="slot{{index}}"> <view class="item flex" v-for="(item,index) in bastList" :key="index" slot="slot{{index}}">
<template v-if="item.storeName==='swiper'"> <template v-if="item.storeName==='swiper'">
<swiper class="item bannar-swiper" autoplay circular> <swiper class="item bannar-swiper" autoplay circular>
<swiper-item v-for="swipe in bannarList" :key="swipe"> <swiper-item v-for="swipe in bannerList" :key="swipe">
<image :src="swipe.pic" mode="aspectFit" @click="goGoodsConByProductID(swipe)"/> <image :src="swipe.pic" mode="aspectFit" @click="goGoodsConByProductID(swipe)"/>
</swiper-item> </swiper-item>
</swiper> </swiper>
@@ -229,40 +229,33 @@
</view> </view>
</uni-popup> </uni-popup>
<!-- 通知消息结束 --> <!-- 通知消息结束 -->
<u-back-top :scroll-top="scrollTop">
<Coupon-window :coupon-list="couponList" v-if="showCoupon" @checked="couponClose" @close="couponClose"> <image
</Coupon-window> :src="webUrl+'/icon/setTop.png'"
mode="scaleToFill"
style="width: 40px;height: 40px;"
@click="setTopHandle"
/>
</u-back-top>
</view> </view>
</template> </template>
<script> <script>
import {mapGetters} from 'vuex';
import PromotionGood from '@/components/PromotionGood';
import CouponWindow from '@/components/CouponWindow';
import CountDown from "@/components/CountDown";
import hxNavbar from "@/components/hx-navbar/hx-navbar.vue"
import imgBox from '@/components/imageTypeSet/imagebox.vue' import imgBox from '@/components/imageTypeSet/imagebox.vue'
import { mapGetters } from 'vuex'
import {getCouponReceive, noticeDetail, noticeList} from "@/api/user"; import { getCouponReceive, noticeDetail, noticeList } from '@/api/user'
import {getHomeData, getShareImage} from '@/api/public'; import { getHomeData, getShareImage } from '@/api/public'
import {getProducts} from "@/api/store"; import { getProducts } from '@/api/store'
import {sharpBannar} from "@/api/goods"; import { sharpBannar } from '@/api/goods'
import NP from "number-precision"; import NP from 'number-precision'
import { pageListenMixins } from '@/mixins/pageListenMixins'
var that;
export default { export default {
name: 'Index', name: 'IndexPage',
components: { components: {
imgBox, imgBox
PromotionGood,
CouponWindow,
CountDown,
hxNavbar
}, },
computed: mapGetters(["userInfo", 'isLogin']), mixins: [pageListenMixins],
props: {}, data() {
data: function () {
return { return {
currentIndex: 0, currentIndex: 0,
speed: 200, speed: 200,
@@ -284,7 +277,7 @@ export default {
menus: [], menus: [],
menuArr: [[], []], menuArr: [[], []],
roll: [], roll: [],
cityName: "", cityName: '',
activity: [], activity: [],
groupGoods: [], groupGoods: [],
activityOne: {}, activityOne: {},
@@ -361,9 +354,9 @@ export default {
liveList: [], liveList: [],
broadcastStyle2: { broadcastStyle2: {
speed: 100, speed: 100,
font_size: "32", //字体大小(rpx) font_size: '32', //字体大小(rpx)
text_color: "#333", //字体颜色 text_color: '#333', //字体颜色
back_color: "red", //背景色 back_color: 'red', //背景色
}, },
bslImglist: [], bslImglist: [],
statusBarHeight: 64, statusBarHeight: 64,
@@ -371,62 +364,60 @@ export default {
preSaleList: [], // 预售商品 preSaleList: [], // 预售商品
month: 0, // 每日特价:月 month: 0, // 每日特价:月
date: 0, // 每日特价:日 date: 0, // 每日特价:日
bannarList: [], // 尖货推荐横幅 bannerList: [], // 尖货推荐横幅
shareAppImg: "", // 发送给朋友 shareAppImg: '', // 发送给朋友
isOldUser: true, // 老用户弹窗 isOldUser: true, // 老用户弹窗
oldUserPopup: {}, oldUserPopup: {},
contentHomestay: {}, contentHomestay: {},
contentFestival: {}, contentFestival: {},
countyFamous: {}, countyFamous: {},
seasonalFood: {} seasonalFood: {},
}; pageKeyId: Object.freeze('appIndex'),
scrollTop: 0
}
}, },
onLoad: function (options) { computed: mapGetters(['userInfo', 'isLogin']),
that = this; onLoad(options) {
this.init(); const _this = this
getShareImage().then(({data}) => this.shareAppImg = data); _this.init()
getShareImage().then(({ data }) => _this.shareAppImg = data)
uni.getSystemInfo({ uni.getSystemInfo({
success: (e) => { success: (e) => {
let statusBar = 0; let statusBar = 0
let customBar = 0; let customBar = 0
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
statusBar = e.statusBarHeight statusBar = e.statusBarHeight
const custom = uni.getMenuButtonBoundingClientRect() const custom = uni.getMenuButtonBoundingClientRect()
customBar = custom.bottom + custom.top - e.statusBarHeight customBar = custom.bottom + custom.top - e.statusBarHeight
// #endif // #endif
_this.statusBarHeight = customBar
that.statusBarHeight = customBar; // 两列商品宽度
//两列商品宽度 _this.hotGoodsColumnWidth = (e.screenWidth - uni.upx2px(90)) / 2 + 'px'
that.hotGoodsColumnWidth = (e.screenWidth - uni.upx2px(90)) / 2 + 'px'; // 状态栏图片高度
//状态栏图片高度 _this.bgImgHeight = statusBar + 'px'
that.bgImgHeight = statusBar + 'px';
} }
}); })
this.testAni()
}, },
onShow: function () { onShow() {
const today = new Date(); const today = new Date()
this.month = today.getMonth() + 1; this.month = today.getMonth() + 1
this.date = today.getDate(); this.date = today.getDate()
// 如果已经登录获取用户信息
//如果已经登录获取用户信息
if (this.isLogin) { if (this.isLogin) {
this.$store.dispatch("getUser", true); this.$store.dispatch('getUser', true)
// 获取最新一条消息
//获取最新一条消息 this.getUnreadMsgList()
this.getUnreadMsgList();
} }
// 获取团购商品 // 获取团购商品
this.getGroupGoods(); this.getGroupGoods()
// fix bug#1113 // fix bug#1113
// if (this.bastList.length > 0) { // if (this.bastList.length > 0) {
// this.getBastList() // this.getBastList()
// } // }
}, },
onHide() {
this.pageToHideHandle()
},
onShareAppMessage() { onShareAppMessage() {
return { return {
title: '探寻有趣有味的生活方式', title: '探寻有趣有味的生活方式',
@@ -440,107 +431,106 @@ export default {
url: '/pkg-video/views/lottery' url: '/pkg-video/views/lottery'
}) })
}, },
onPageScroll(e) {
this.scrollTop = e.scrollTop
},
methods: { methods: {
init() { init() {
let that = this; const _this = this
sharpBannar().then(response => {
sharpBannar().then(({data}) => { _this.bannerList = response.data.banner
this.bannarList = data.banner uni.showLoading({ title: '加载中' })
uni.showLoading({
title: '加载中'
});
getHomeData().then(res => { getHomeData().then(res => {
that.logoUrl = res.data.logoUrl; const { data } = res
that.$set(that, 'banner', res.data.banner); _this.logoUrl = data.logoUrl
_this.$set(_this, 'banner', data.banner)
that.$set(that, 'menus', res.data.menus) _this.$set(_this, 'menus', data.menus)
res.data.menus?.forEach((item, index) => { data.menus?.forEach((item, index) => {
if (index % 2 === 0) { if (index % 2 === 0) {
that.menuArr[0].push(item) _this.menuArr[0].push(item)
} else { } else {
that.menuArr[1].push(item) _this.menuArr[1].push(item)
} }
}) })
that.$set(that, 'roll', res.data.roll); _this.$set(_this, 'roll', data.roll)
that.$set(that, 'userList', res.data.lotteryRecord); //滚动会员信息 // 滚动会员信息
that.$set(that, 'info', res.data.info); _this.$set(_this, 'userList', data.lotteryRecord)
that.$set(that, 'firstList', res.data.firstList.map((item) => { _this.$set(_this, 'info', data.info)
item.price = that.$force2Decimal(item.price); _this.$set(_this, 'firstList', data.firstList.map((item) => {
//如果已经登录获取用户信息 item.price = _this.$force2Decimal(item.price)
if (that.$store.getters.token && that.userInfo) { // 如果已经登录获取用户信息
var p = NP.times(item.price, NP.divide(parseFloat(that.userInfo.discount), if (_this.$store.getters.token && _this.userInfo) {
100)) const p = NP.times(item.price, NP.divide(parseFloat(_this.userInfo.discount), 100))
item.vipPrice = that.$force2Decimal(p); item.vipPrice = _this.$force2Decimal(p)
} }
return item; return item
})); }))
that.$set(that, 'oldUserPopup', res.data.oldUserPopup) _this.$set(_this, 'oldUserPopup', data.oldUserPopup)
that.$set(that, 'contentHomestay', res.data.contentHomestay) _this.$set(_this, 'contentHomestay', data.contentHomestay)
that.$set(that, 'contentFestival', res.data.contentFestival) _this.$set(_this, 'contentFestival', data.contentFestival)
that.$set(that, 'countyFamous', res.data.countyFamous) _this.$set(_this, 'countyFamous', data.countyFamous)
// 处理时令尝鲜轮播图所需数据 // 处理时令尝鲜轮播图所需数据
const foodLen = res.data.seasonalFood.productsCarousels.length; const foodLen = data.seasonalFood.productsCarousels.length
const foods = res.data.seasonalFood.productsCarousels; const foods = data.seasonalFood.productsCarousels
let groupList = []; const groupList = []
if (foodLen) { if (foodLen) {
const count = 4; const count = 4
for (let i = 0; i < foodLen; i += count) { for (let i = 0; i < foodLen; i += count) {
groupList.push(foods.slice(i, i + count)) groupList.push(foods.slice(i, i + count))
} }
} }
res.data.seasonalFood.groupList = groupList; data.seasonalFood.groupList = groupList
that.$set(that, 'seasonalFood', res.data.seasonalFood) _this.$set(_this, 'seasonalFood', data.seasonalFood)
if (that.firstList.length > 0) { if (_this.firstList.length > 0) {
that.newGoods = that.firstList[0]; _this.newGoods = _this.firstList[0]
} }
that.$set(that, 'likeInfo', res.data.likeInfo.map((item) => { _this.$set(_this, 'likeInfo', data.likeInfo.map((item) => {
item.price = that.$force2Decimal(item.price); item.price = _this.$force2Decimal(item.price)
item.otPrice = that.$force2Decimal(item.otPrice); item.otPrice = _this.$force2Decimal(item.otPrice)
//如果已经登录获取用户信息 // 如果已经登录获取用户信息
if (that.$store.getters.token && that.userInfo) { if (_this.$store.getters.token && _this.userInfo) {
var p = NP.times(item.price, NP.divide(parseFloat(that.userInfo.discount), const p = NP.times(item.price, NP.divide(parseFloat(_this.userInfo.discount), 100))
100)) item.vipPrice = _this.$force2Decimal(p)
item.vipPrice = that.$force2Decimal(p);
} }
return item; return item
})); }))
setTimeout(() => { setTimeout(() => {
//伴手礼图片 // 伴手礼图片
var imgs = []; const imgs = []
that.likeInfo.forEach((item) => { _this.likeInfo.forEach((item) => {
imgs.push(item.image); imgs.push(item.image)
}) })
that.$set(that, 'bslImglist', imgs); _this.$set(_this, 'bslImglist', imgs)
_this.seriesWidth = 770 * imgs.length - 20
that.seriesWidth = 770 * imgs.length - 20; _this.duration = Math.floor(_this.seriesWidth / _this.speed * 1000)
that.duration = Math.floor(that.seriesWidth / that.speed * 1000);
}, 1) }, 1)
for (let i = 0; i < res.data.bastList.length; i++) { for (let i = 0; i < data.bastList.length; i++) {
res.data.bastList[i].hide = true; data.bastList[i].hide = true
} }
that.$set(that, 'bastList', res.data.bastList); _this.$set(_this, 'bastList', data.bastList)
that.$set(that, 'lovely', res.data.lovely); _this.$set(_this, 'lovely', data.lovely)
that.$set(that, 'benefit', res.data.benefit); _this.$set(_this, 'benefit', data.benefit)
that.$set(that, 'couponList', res.data.couponList); _this.$set(_this, 'couponList', data.couponList)
that.$set(that, 'companyName', res.data.companyName); _this.$set(_this, 'companyName', data.companyName)
that.$set(that, 'companyAddress', res.data.companyAddress); _this.$set(_this, 'companyAddress', data.companyAddress)
that.$set(that, 'companyTel', res.data.companyTel); _this.$set(_this, 'companyTel', data.companyTel)
that.$set(that, 'companyLogo', res.data.companyLogo); _this.$set(_this, 'companyLogo', data.companyLogo)
that.$set(that, 'dailyGoodsList', res.data.dailyGoodsList); _this.$set(_this, 'dailyGoodsList', data.dailyGoodsList)
that.$set(that, 'preSaleList', res.data.preSaleList); _this.$set(_this, 'preSaleList', data.preSaleList)
uni.hideLoading()
uni.hideLoading(); }).catch(() => {
}); uni.hideLoading()
}); })
})
}, },
getBastList() { getBastList() {
getHomeData().then(res => { getHomeData().then(res => {
@@ -554,61 +544,48 @@ export default {
}) })
}, },
getGroupGoods() { getGroupGoods() {
var params = { getProducts({
page: 1, page: 1,
limit: 1, limit: 1,
sid: 19, //团购id=19 sid: 19, //团购id=19
news: 0, news: 0,
priceOrder: "", priceOrder: '',
salesOrder: "" salesOrder: ''
} }).then(res => {
var _this = this; this.groupGoods = res.data
getProducts(params)
.then(res => {
_this.groupGoods = res.data;
})
.catch(err => {
})
},
clickItem(data) {
this.goGoodsCon(data);
},
msgConfirm: function () {
that.$refs.popup.close();
},
goPreSale: function () {
this.$yrouter.push("/v4/views/preSale/preSale")
},
goOffer: function () {
this.$yrouter.push("/v4/views/offer/offer")
},
setMsgReaded: function (mid) {
noticeDetail({
id: mid
}) })
}, },
getUnreadMsgList: function () { clickItem(data) {
var params = { this.goGoodsCon(data)
},
msgConfirm: function () {
this.$refs.popup.close()
},
goPreSale: function () {
this.$yrouter.push('/v4/views/preSale/preSale')
},
goOffer: function () {
this.$yrouter.push('/v4/views/offer/offer')
},
setMsgReaded(mid) {
noticeDetail({ id: mid })
},
getUnreadMsgList() {
noticeList({
limit: 10, limit: 10,
page: 1 page: 1
} }).then(res => {
let that = this;
noticeList(params).then(res => {
if (res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
var msg = res.data[0]; const msg = res.data[0]
if (msg.readFlag == 'RF0') { if (msg.readFlag == 'RF0') {
that.unReadMessageInfo = msg; this.unReadMessageInfo = msg
that.$refs.popup.open(); this.$refs.popup.open()
that.setMsgReaded(msg.id); this.setMsgReaded(msg.id)
} }
} }
}) })
}, },
call() {
call: function () {
if (this.companyTel != undefined && this.companyTel.length > 0) { if (this.companyTel != undefined && this.companyTel.length > 0) {
uni.makePhoneCall({ uni.makePhoneCall({
// 手机号 // 手机号
@@ -621,10 +598,8 @@ export default {
} }
}); });
} else { } else {
this.$dialog.error('电话为空'); this.$dialog.error('电话为空')
} }
}, },
goRoll(item) { goRoll(item) {
if (item.uniapp_url) { if (item.uniapp_url) {
@@ -632,7 +607,7 @@ export default {
} }
}, },
goGoodSearch() { goGoodSearch() {
this.$yrouter.push('/pages/shop/GoodSearch/index'); this.$yrouter.push('/pages/shop/GoodSearch/index')
}, },
goGoodsCon(item) { goGoodsCon(item) {
this.$yrouter.push({ this.$yrouter.push({
@@ -640,7 +615,7 @@ export default {
query: { query: {
id: item.id id: item.id
} }
}); })
}, },
goGoodsConByProductID(item, from) { goGoodsConByProductID(item, from) {
this.$yrouter.push({ this.$yrouter.push({
@@ -650,19 +625,16 @@ export default {
activityId: item.id, activityId: item.id,
from from
} }
}); })
}, },
changeOldPopup(state) { changeOldPopup(state) {
this.isOldUser = state; this.isOldUser = state
}, },
goHomeStay(stay) { goHomeStay(stay) {
if (stay.uniappUrl) { if (stay.uniappUrl) {
this.$global.commonJump(stay.uniappUrl) this.$global.commonJump(stay.uniappUrl)
return return
} }
if (stay.type === 2 && stay.isLinkToProduct) { if (stay.type === 2 && stay.isLinkToProduct) {
this.$yrouter.push({ this.$yrouter.push({
path: '/pages/shop/GoodsCon/index', path: '/pages/shop/GoodsCon/index',
@@ -676,13 +648,20 @@ export default {
uni.navigateTo({url: '/pkg_product/views/homestay?id=' + stay.id}) uni.navigateTo({url: '/pkg_product/views/homestay?id=' + stay.id})
} }
}, },
goFestival() { goFestival() {
uni.navigateTo({url: '/pkg_product/views/festival'}) uni.navigateTo({url: '/pkg_product/views/festival'})
}, },
tapOld() { tapOld() {
this.isOldUser = false this.isOldUser = false
const {type, text, jumpTime, pageLevel, url, params, couponId} = this.oldUserPopup const {
type,
text,
jumpTime,
pageLevel,
url,
params,
couponId
} = this.oldUserPopup
if (couponId != null) { if (couponId != null) {
getCouponReceive(couponId).then(res => { getCouponReceive(couponId).then(res => {
if (res.status === 200) { if (res.status === 200) {
@@ -710,15 +689,14 @@ export default {
this.$global.levelJump(pageLevel, url, params) this.$global.levelJump(pageLevel, url, params)
} }
}, },
setTopHandle() {
testAni() { uni.pageScrollTo({
const query = uni.createSelectorQuery().in(this).select('.index') scrollTop: 0,
query.fields({size: true, scrollOffset: true}, (data) => { duration: 200
console.log(JSON.stringify(data)) })
}).exec()
} }
} }
}; }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
+89 -72
View File
@@ -1,8 +1,87 @@
<template>
<view class="pkg-product-land-mark" v-if="mapData">
<view class="top-box" :style="{'backgroundColor':topBoxBgColor}">
<view class="view-box">
<view class="search-box flex ai-center">
<input
v-model="keyword"
type="text"
placeholder="搜索商品"
placeholder-style="color:#999"
@confirm="search()"
/>
<image
:src="webUrl+'/20231223183627184005.png'"
mode="scaleToFill"
style="width:30rpx;height:30rpx"
@click="search()"
/>
</view>
<view class="map-box">
<image class="img-map" :src="mapData.mapImage" mode="widthFix"/>
<view
v-for="(item, index) in mapLocations"
:key="index"
class="item"
:style="{'left':item.gx+'rpx','top':item.gy+'rpx'}"
@click="goGoods(item.productId)"
>
<view class="round">
<view class="line" :class="'line-'+directionClass[item.labelDirection]"></view>
</view>
<view class="label flex ai-end" :class="'label-'+directionClass[item.labelDirection]">
<image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection===4"/>
<view class="title flex ai-center">{{ item.mapTitle }}</view>
<image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection!==4"/>
</view>
</view>
</view>
</view>
<view class="nav flex">
<view class="flex flex-0 ai-center" :class="{'active': navIndex===index}" v-for="(item,index) in navList"
:key="index" @click="changeNav(index)">{{ item.provinceName }}
</view>
</view>
</view>
<view class="main-box" v-if="mapData.recommended.storeImage"
@click="goGoods(mapData.recommended.productId)">
<image class="bg-main" :src="mapData.recommended.storeImage" mode="scaleToFill"/>
<view class="box-mask flex flex-col jc-end">
<view class="one-t bold">{{ mapData.recommended.title }}</view>
<view class="more-t">{{ mapData.recommended.description }}</view>
</view>
</view>
<view class="list-box flex flex-wrap">
<view class="item" v-for="item in goods" :key="item.id" @click="goGoods(item.productId)">
<image :src="item.storeImage" mode="scaleToFill"/>
<view class="content flex flex-col jc-between">
<view class="more-t bold">{{ item.title }}</view>
<view class="flex jc-between ai-center">
<text class="price">{{ item.price }}</text>
<image class="btn" :src="webUrl+'/20231114151028082368.png'" mode="scaleToFill"/>
<!-- <view class="btn flex jc-center ai-center">立即购买</view>-->
</view>
</view>
</view>
</view>
<image class="img-nodata" :src="webUrl+'/20231023131208675588.png'" mode="scaleToFill"
v-if="goods.length===0"/>
</view>
</template>
<script> <script>
import {getProvince, getProvinceGoods, getProvinceList} from "@/api/product"; import {getProvince, getProvinceGoods, getProvinceList} from "@/api/product";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "landMark", name: 'LandMarkPage',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -14,6 +93,7 @@ export default {
mapLocations: [], mapLocations: [],
goods: [], goods: [],
directionClass: ['', 'up', 'right', 'down', 'left'], directionClass: ['', 'up', 'right', 'down', 'left'],
pageKeyId: Object.freeze('landmarkGoodsIndex')
} }
}, },
computed: { computed: {
@@ -30,6 +110,9 @@ export default {
onLoad() { onLoad() {
this.getNavList(); this.getNavList();
}, },
onHide() {
this.pageToHideHandle()
},
onReachBottom() { onReachBottom() {
this.page++; this.page++;
this.fetchGoods(); this.fetchGoods();
@@ -79,82 +162,16 @@ export default {
this.goods.push(data[i]); this.goods.push(data[i]);
} }
}) })
},
goGoods(id) {
uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${id}&from=landmark`
})
} }
} }
} }
</script> </script>
<template>
<view class="pkg-product-land-mark" v-if="mapData">
<view class="top-box" :style="{'backgroundColor':topBoxBgColor}">
<view class="view-box">
<view class="search-box flex ai-center">
<input
v-model="keyword"
type="text"
placeholder="搜索商品"
placeholder-style="color:#999"
@confirm="search()"
/>
<image
:src="webUrl+'/20231223183627184005.png'"
mode="scaleToFill"
style="width:30rpx;height:30rpx"
@click="search()"
/>
</view>
<view class="map-box">
<image class="img-map" :src="mapData.mapImage" mode="widthFix"/>
<view class="item" :style="{'left':item.gx+'rpx','top':item.gy+'rpx'}" v-for="item in mapLocations" @click="$global.navToGoods(item.productId)">
<view class="round">
<view class="line" :class="'line-'+directionClass[item.labelDirection]"></view>
</view>
<view class="label flex ai-end" :class="'label-'+directionClass[item.labelDirection]">
<image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection===4"/>
<view class="title flex ai-center">{{ item.mapTitle }}</view>
<image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection!==4"/>
</view>
</view>
</view>
</view>
<view class="nav flex">
<view class="flex flex-0 ai-center" :class="{'active': navIndex===index}" v-for="(item,index) in navList"
:key="index" @click="changeNav(index)">{{ item.provinceName }}
</view>
</view>
</view>
<view class="main-box" v-if="mapData.recommended.storeImage"
@click="$global.navToGoods(mapData.recommended.productId)">
<image class="bg-main" :src="mapData.recommended.storeImage" mode="scaleToFill"/>
<view class="box-mask flex flex-col jc-end">
<view class="one-t bold">{{ mapData.recommended.title }}</view>
<view class="more-t">{{ mapData.recommended.description }}</view>
</view>
</view>
<view class="list-box flex flex-wrap">
<view class="item" v-for="item in goods" :key="item.id" @click="$global.navToGoods(item.productId)">
<image :src="item.storeImage" mode="scaleToFill"/>
<view class="content flex flex-col jc-between">
<view class="more-t bold">{{ item.title }}</view>
<view class="flex jc-between ai-center">
<text class="price">{{ item.price }}</text>
<image class="btn" :src="webUrl+'/20231114151028082368.png'" mode="scaleToFill"/>
<!-- <view class="btn flex jc-center ai-center">立即购买</view>-->
</view>
</view>
</view>
</view>
<image class="img-nodata" :src="webUrl+'/20231023131208675588.png'" mode="scaleToFill"
v-if="goods.length===0"/>
</view>
</template>
<style scoped lang="less"> <style scoped lang="less">
.pkg-product-land-mark { .pkg-product-land-mark {
background: #F7F3ED; background: #F7F3ED;
+95 -86
View File
@@ -36,7 +36,7 @@
</picker> </picker>
<view class="item textarea acea-row row-between"> <view class="item textarea acea-row row-between">
<view>备注说明</view> <view>备注说明</view>
<textarea placeholder="填写备注信息,100字以内" class="num" v-model="refundReasonWapExplain"></textarea> <textarea placeholder="填写备注信息,100字以内" class="num inp" v-model="refundReasonWapExplain"></textarea>
</view> </view>
</view> </view>
<view class="returnBnt bg-color-red" @click="submit">申请退款</view> <view class="returnBnt bg-color-red" @click="submit">申请退款</view>
@@ -44,97 +44,106 @@
</template> </template>
<script> <script>
import { import {
orderDetail, orderDetail,
getRefundReason, getRefundReason,
postOrderRefund postOrderRefund
} from "@/api/order"; } from "@/api/order";
import { import {
trim trim
} from "@/utils"; } from "@/utils";
import { import {
VUE_APP_API_URL VUE_APP_API_URL
} from "@/config"; } from "@/config";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "goodsReturn", name: "goodsReturn",
components: { components: {
// VueCoreImageUpload // VueCoreImageUpload
},
mixins: [pageListenMixins],
data() {
return {
url: `${VUE_APP_API_URL}/upload/image`,
headers: {
Authorization: "Bearer " + this.$store.state.token
},
id: 0,
orderInfo: {},
reasonList: [],
reason: "",
refundReasonWapExplain: "",
pageKeyId: Object.freeze('userOrderRefundApply')
};
},
methods: {
changeReason(e) {
this.reason = this.reasonList[e.mp.detail.value];
}, },
data() { getOrderDetail() {
return { orderDetail(this.id)
url: `${VUE_APP_API_URL}/upload/image`, .then(res => {
headers: { this.orderInfo = res.data;
Authorization: "Bearer " + this.$store.state.token })
}, .catch(err => {
id: 0,
orderInfo: {},
reasonList: [],
reason: "",
refundReasonWapExplain: ""
};
},
methods: {
changeReason(e) {
this.reason = this.reasonList[e.mp.detail.value];
},
getOrderDetail() {
orderDetail(this.id)
.then(res => {
this.orderInfo = res.data;
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
});
});
},
getRefundReason() {
getRefundReason().then(res => {
this.reasonList = res.data;
});
},
submit() {
const refundReasonWapExplain = trim(this.refundReasonWapExplain),
text = this.reason;
if (!text) {
uni.showToast({ uni.showToast({
title: "请选择退款原因", title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); });
return });
}
postOrderRefund({
text,
uni: this.orderInfo.orderId,
refundReasonWapExplain
})
.then(res => {
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
setTimeout(() => {
this.$yrouter.back();
}, 1500);
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
});
});
}
}, },
mounted() { getRefundReason() {
this.id = this.$yroute.query.id || 0; getRefundReason().then(res => {
this.getOrderDetail(); this.reasonList = res.data;
this.getRefundReason(); });
},
submit() {
const refundReasonWapExplain = trim(this.refundReasonWapExplain),
text = this.reason;
if (!text) {
uni.showToast({
title: "请选择退款原因",
icon: 'none',
duration: 2000
});
return
}
postOrderRefund({
text,
uni: this.orderInfo.orderId,
refundReasonWapExplain
})
.then(res => {
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
setTimeout(() => {
this.$yrouter.back();
}, 1500);
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
});
});
} }
}; },
mounted() {
this.id = this.$yroute.query.id || 0;
this.getOrderDetail();
this.getRefundReason();
}
};
</script> </script>
<style scoped>
.apply-return .list .item .inp {
padding: 4rpx 20rpx;
text-align: left;
}
</style>
+10 -6
View File
@@ -145,9 +145,11 @@ import {cancelOrderHandle, payOrderHandle, takeOrderHandle} from "@/libs/order";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import Payment from "@/components/Payment"; import Payment from "@/components/Payment";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "MyOrder", name: "MyOrder",
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -172,6 +174,7 @@ export default {
showExtend: false, showExtend: false,
delayId: null, delayId: null,
pageKeyId: Object.freeze('userOrderIndex')
}; };
}, },
components: { components: {
@@ -180,10 +183,10 @@ export default {
}, },
computed: mapGetters(["userInfo"]), computed: mapGetters(["userInfo"]),
onShow: function () { onShow: function () {
this.type = parseInt(this.$yroute.query.type) || 0; this.type = this.type || parseInt(this.$yroute.query.type) || 0;
this.changeType(this.type); this.changeType(this.type);
this.getOrderData(); this.getOrderData();
this.getOrderList(); this.getOrderListReq();
}, },
onHide: function () { onHide: function () {
this.orderList = []; this.orderList = [];
@@ -202,7 +205,8 @@ export default {
}) })
}, },
goRefund(order) { goRefund(order) {
if (this.type === 4) { // fix bug#1631
if (this.type === 4 || parseInt(order._status._type) === 3) {
uni.showToast({ uni.showToast({
title: '订单已收货,如需退款请联系客服', title: '订单已收货,如需退款请联系客服',
mask: false, mask: false,
@@ -300,9 +304,9 @@ export default {
this.page = 1; this.page = 1;
this.loaded = false; this.loaded = false;
this.loading = false; this.loading = false;
this.getOrderList(); this.getOrderListReq();
}, },
getOrderList() { getOrderListReq() {
if (this.loading || this.loaded) return; if (this.loading || this.loaded) return;
this.loading = true; this.loading = true;
const { const {
@@ -413,7 +417,7 @@ export default {
} }
}, },
onReachBottom() { onReachBottom() {
!this.loading && this.getOrderList(); !this.loading && this.getOrderListReq();
} }
}; };
</script> </script>
+17 -8
View File
@@ -130,7 +130,7 @@
</view> </view>
<view class="item acea-row row-between" v-if="orderInfo.mark"> <view class="item acea-row row-between" v-if="orderInfo.mark">
<view class="flex-0">买家留言</view> <view class="flex-0">买家留言</view>
<view class="conter">{{ orderInfo.mark }}</view> <view class="conter conttent-left">{{ orderInfo.mark }}</view>
</view> </view>
</view> </view>
@@ -233,9 +233,11 @@
</template> </template>
<template v-if="status.type == 4"> <template v-if="status.type == 4">
<view class="bnt cancel" @click="delOrder">删除订单</view> <view class="bnt cancel" @click="delOrder">删除订单</view>
<view class="bnt default" @click=" <view
$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }}) v-if="orderInfo.isTickets !== 1"
" v-if="orderInfo.isTickets!==1">查看物流 class="bnt default"
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})"
>查看物流
</view> </view>
</template> </template>
<template v-if="status.type == 6"> <template v-if="status.type == 6">
@@ -263,6 +265,7 @@ import DataFormat from "@/components/DataFormat";
import {copyClipboard} from "@/utils"; import {copyClipboard} from "@/utils";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import {cancelOrderHandle, delOrderHandle, payOrderHandle, takeOrderHandle, yuePayOrderHandle} from "@/libs/order"; import {cancelOrderHandle, delOrderHandle, payOrderHandle, takeOrderHandle, yuePayOrderHandle} from "@/libs/order";
import { pageListenMixins } from '@/mixins/pageListenMixins'
const STATUS = [ const STATUS = [
"待付款", "待付款",
@@ -286,7 +289,7 @@ export default {
DataFormat, DataFormat,
passkeyborad passkeyborad
}, },
props: {}, mixins: [pageListenMixins],
data: function () { data: function () {
return { return {
isShowPayPwdPop: false, isShowPayPwdPop: false,
@@ -306,7 +309,8 @@ export default {
mapKay: "", mapKay: "",
mapShow: false, mapShow: false,
payPassword: null, payPassword: null,
webUrl: this.$VUE_APP_RESOURCES_URL webUrl: this.$VUE_APP_RESOURCES_URL,
pageKeyId: Object.freeze('userOrderInfo')
}; };
}, },
computed: { computed: {
@@ -483,8 +487,8 @@ export default {
}, },
delOrder() { delOrder() {
delOrderHandle(this.orderInfo.orderId).then(() => { delOrderHandle(this.orderInfo.orderId).then(() => {
setTimeout(() => this.goBack(), 300); this.goBack()
}); })
}, },
setOfflinePayStatus: function (status) { setOfflinePayStatus: function (status) {
var that = this; var that = this;
@@ -768,4 +772,9 @@ export default {
color: #FE5261; color: #FE5261;
font-size: 26rpx; font-size: 26rpx;
} }
.item {
.conttent-left {
text-align: left !important;
}
}
</style> </style>
+4 -1
View File
@@ -256,6 +256,7 @@ import {isNullOrEmpty, isWeixin} from "@/utils";
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue'; import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue';
import uniPopup from '@/components/uni-popup/uni-popup.vue'; import uniPopup from '@/components/uni-popup/uni-popup.vue';
import CouponsPopup from "@/components/CouponsPopup.vue" import CouponsPopup from "@/components/CouponsPopup.vue"
import { pageListenMixins } from '@/mixins/pageListenMixins'
const NAME = "OrderSubmission", const NAME = "OrderSubmission",
_isWeixin = isWeixin(); _isWeixin = isWeixin();
@@ -269,6 +270,7 @@ export default {
passkeyborad, passkeyborad,
CouponsPopup CouponsPopup
}, },
mixins: [pageListenMixins],
props: {}, props: {},
data: function () { data: function () {
return { return {
@@ -317,7 +319,8 @@ export default {
// 订单是否可以使用积分 // 订单是否可以使用积分
canUsePoints: false, canUsePoints: false,
// 订单最大可使用积分数量 // 订单最大可使用积分数量
maxPoints: 0 maxPoints: 0,
pageKeyId: Object.freeze('orderConfirm')
}; };
}, },
computed: mapGetters(["userInfo", "storeItems"]), computed: mapGetters(["userInfo", "storeItems"]),
+4 -1
View File
@@ -48,12 +48,14 @@
<script> <script>
import {getOrderList} from "@/api/order"; import {getOrderList} from "@/api/order";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "ReturnList", name: "ReturnList",
components: { components: {
Loading Loading
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -61,7 +63,8 @@ export default {
page: 1, page: 1,
limit: 20, limit: 20,
loading: false, loading: false,
loaded: false loaded: false,
pageKeyId: Object.freeze('userOrderRefundList')
}; };
}, },
methods: { methods: {
+53 -6
View File
@@ -13,7 +13,7 @@
<view class="wrapper"> <view class="wrapper">
<!-- 原模块 --> <!-- 原模块 -->
<view class="change-section bg-white" v-if="source==='' || source==='famous' "> <view class="change-section bg-white" v-if="source !== 'pre' && source !== 'day' && source !== 'kill' && source !== 'spe'">
<view class="introduce bold">{{ storeInfo.storeName }}</view> <view class="introduce bold">{{ storeInfo.storeName }}</view>
<rich-text class="subInfo" :nodes="storeInfo.storeInfo" v-if="storeInfo.storeInfo"/> <rich-text class="subInfo" :nodes="storeInfo.storeInfo" v-if="storeInfo.storeInfo"/>
<view class="share acea-row row-between row-middle" style="flex-wrap: nowrap;"> <view class="share acea-row row-between row-middle" style="flex-wrap: nowrap;">
@@ -142,7 +142,7 @@
<view class="label acea-row row-middle row-around" style="color: #666666;flex-wrap: nowrap;"> <view class="label acea-row row-middle row-around" style="color: #666666;flex-wrap: nowrap;">
<text>库存:{{ dayInfo.stock }}{{ dayInfo.unitName }}</text> <text>库存:{{ dayInfo.stock }}{{ dayInfo.unitName }}</text>
<text v-if="tempName">{{ tempName }}</text> <text v-if="tempName">{{ tempName }}</text>
<text>销量:{{ dayInfo.sales }}{{ dayInfo.unitName }}</text> <!-- <text>销量:{{ dayInfo.sales }}{{ dayInfo.unitName }}</text> -->
</view> </view>
</view> </view>
@@ -201,7 +201,7 @@
<view class="after-title">快递</view> <view class="after-title">快递</view>
<view class="title bold">{{ storeInfo.postage === 0 ? "免运费" : `${storeInfo.postage}` }}</view> <view class="title bold">{{ storeInfo.postage === 0 ? "免运费" : `${storeInfo.postage}` }}</view>
</view> </view>
<view class="value red">销量{{ storeInfo.sales }}</view> <!-- <view class="value red">销量{{ storeInfo.sales }}</view> -->
</view> </view>
<view class="cell flex jc-between ai-center" v-if="storeInfo.guarantee"> <view class="cell flex jc-between ai-center" v-if="storeInfo.guarantee">
@@ -422,6 +422,7 @@ import cookie from "@/utils/store/cookie";
import {famousGoodsShareImage, secKillGoodsShareImage} from "@/api/share"; import {famousGoodsShareImage, secKillGoodsShareImage} from "@/api/share";
import CouponsPopup from "@/components/CouponsPopup.vue" import CouponsPopup from "@/components/CouponsPopup.vue"
import {addProduct, checkProduct, removeProduct} from "@/api/favorite"; import {addProduct, checkProduct, removeProduct} from "@/api/favorite";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "GoodsCon", name: "GoodsCon",
@@ -434,6 +435,7 @@ export default {
ShareInfo, ShareInfo,
CouponsPopup CouponsPopup
}, },
mixins: [pageListenMixins],
data: function () { data: function () {
return { return {
isProductInfoExpand: true, //商品信息是否展开 isProductInfoExpand: true, //商品信息是否展开
@@ -504,7 +506,8 @@ export default {
// v9-2 // v9-2
show: false, show: false,
uniqueId: null, uniqueId: null,
isFavorite: false isFavorite: false,
pageKeyId: ''
}; };
}, },
computed: mapGetters(["isLogin", "location", "userInfo"]), computed: mapGetters(["isLogin", "location", "userInfo"]),
@@ -541,6 +544,50 @@ export default {
console.log("getEnterOptionsSync", uni.getEnterOptionsSync()); console.log("getEnterOptionsSync", uni.getEnterOptionsSync());
uni.removeStorageSync('couponId') uni.removeStorageSync('couponId')
const from = options.from
const id = options.id
switch (from) {
// 特产
case 'techan':
this.pageKeyId = `product_from_goods_productId_${id}`
break
// 地标好物
case 'landmark':
this.pageKeyId = `product_from_landmarkGoods_productId_${id}`
break
// 节日
case 'gift':
this.pageKeyId = `product_from_appContentFestival_productId_${id}`
break
// 时令尝鲜
case 'season':
this.pageKeyId = `product_from_seasonalFood_productId_${id}`
break
// 秒杀
case 'kill':
this.pageKeyId = `seckillProduct_seckillId_${options.activityId}`
break
// 文玩
case 'wenwan':
this.pageKeyId = `product_from_wenwan_productId_${id}`
break
// 非遗文化
case 'ich':
this.pageKeyId = `product_from_ich_productId_${id}`
break
// 康养食材
case 'wellness':
this.pageKeyId = `product_from_wellnessFood_productId_${id}`
break
// 千县
case 'famous':
this.pageKeyId = `product_from_countyFamous_productId_${id}`
break
default:
this.pageKeyId = `product_from_common_productId_${id}`
break
}
let url = handleQrCode(); let url = handleQrCode();
if (url && url.productId) { if (url && url.productId) {
this.id = url.productId; this.id = url.productId;
@@ -837,7 +884,7 @@ export default {
this.posterImageStatus = !this.posterImageStatus; this.posterImageStatus = !this.posterImageStatus;
this.posters = false; this.posters = false;
}, },
//产品详情接口 // 产品详情接口
productCon: function () { productCon: function () {
const from = this.location const from = this.location
if (this.$deviceType == 'app') { if (this.$deviceType == 'app') {
@@ -855,7 +902,7 @@ export default {
this.$set(this, 'storeInfo', data.storeInfo) this.$set(this, 'storeInfo', data.storeInfo)
this.isWenwan = data.isWenwan this.isWenwan = data.isWenwan
// 给 attr 赋值,将请求回来的规格赋值给 attr // 给 attr 赋值,将请求回来的规格赋值给 attr
if (this.source === '' || this.source === 'famous') { if (this.source !== 'pre' && this.source !== 'day' && this.source !== 'kill' && this.source !== 'spe') {
this.$set(this.attr, 'productAttr', data.productAttr) this.$set(this.attr, 'productAttr', data.productAttr)
this.productValueArr = [] this.productValueArr = []
for (const key in data.productValue) { for (const key in data.productValue) {
+6 -4
View File
@@ -89,12 +89,12 @@
<view v-if="list.length === 0" class="no-data"> <view v-if="list.length === 0" class="no-data">
暂无数据 暂无数据
</view> </view>
<u-loadmore <!-- <u-loadmore
v-if="query.page >= totalPage && list.length > 0" v-if="query.page >= totalPage && list.length > 0"
:line="true" :line="true"
status="nomore" status="nomore"
nomore-text="到底了" nomore-text="到底了"
/> /> -->
</view> </view>
</view> </view>
</view> </view>
@@ -125,9 +125,10 @@ import {
getUserPointInfo, getUserPointInfo,
getUserPointBill getUserPointBill
} from '@/api/user' } from '@/api/user'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'UserPoints', name: 'UserPoints',
props: {}, mixins: [pageListenMixins],
data: function() { data: function() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -145,7 +146,8 @@ export default {
totalUsedPoints: 0, // 累计使用积分 totalUsedPoints: 0, // 累计使用积分
pointsRule: '' pointsRule: ''
}, },
show: false show: false,
pageKeyId: Object.freeze('userPointsBill')
} }
}, },
created() { created() {
+12 -3
View File
@@ -31,7 +31,9 @@
<view class="info"> <view class="info">
<view class="name-cont"> <view class="name-cont">
<view class="txt flex"> <view class="txt flex">
{{ userInfo.nickname }} <view class="txt-cont">
{{ userInfo.nickname }}
</view>
<image <image
:src="webUrl + '/page/my/img-vip.png'" :src="webUrl + '/page/my/img-vip.png'"
class="vip" class="vip"
@@ -251,8 +253,10 @@ import {
} from "@/api/user" } from "@/api/user"
import {isWeixin} from "@/utils" import {isWeixin} from "@/utils"
import cookie from "@/utils/store/cookie" import cookie from "@/utils/store/cookie"
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'UserPage', name: 'UserPage',
mixins: [pageListenMixins],
data() { data() {
return { return {
statusBarHeight: uni.getSystemInfoSync().statusBarHeight, statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
@@ -330,7 +334,8 @@ export default {
} }
], ],
bannerBgUrl: '', bannerBgUrl: '',
userCenterBannerUrl: '' userCenterBannerUrl: '',
pageKeyId: Object.freeze('userIndex')
} }
}, },
computed: mapGetters(['userInfo']), computed: mapGetters(['userInfo']),
@@ -358,6 +363,7 @@ export default {
}, },
onHide() { onHide() {
this.updateAuthorizationPage(false) this.updateAuthorizationPage(false)
this.pageToHideHandle()
}, },
methods: { methods: {
...mapMutations(['updateAuthorizationPage']), ...mapMutations(['updateAuthorizationPage']),
@@ -630,10 +636,13 @@ export default {
color: #fff; color: #fff;
.name-cont { .name-cont {
.txt { .txt {
align-items: flex-end; align-items: baseline;
margin: 0 0 32rpx 0; margin: 0 0 32rpx 0;
font-size: 26px; font-size: 26px;
line-height: 26px; line-height: 26px;
.txt-cont {
max-width: 400rpx;
}
.vip { .vip {
margin: 0 0 0 12rpx; margin: 0 0 0 12rpx;
width: 48rpx; width: 48rpx;
+16 -2
View File
@@ -25,19 +25,24 @@
</view> </view>
</view> </view>
<Loading :loaded="loaded" :loading="loading"></Loading> <Loading :loaded="loaded" :loading="loading"></Loading>
<view v-if="loaded && list.length === 0">
<image :src="webUrl + '/noConsumption.png'" class="no-data"></image>
</view>
</view> </view>
</template> </template>
<script> <script>
import { getCommissionInfo } from "@/api/user"; import { getCommissionInfo } from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "UserBill", name: "UserBill",
components: { components: {
Loading Loading
}, },
props: {}, mixins: [pageListenMixins],
data: function() { data: function() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL,
types: 0, types: 0,
where: { where: {
page: 1, page: 1,
@@ -45,7 +50,8 @@ export default {
}, },
list: [], list: [],
loaded: false, loaded: false,
loading: false loading: false,
pageKeyId: Object.freeze('userBalanceBill')
}; };
}, },
watch: { watch: {
@@ -112,3 +118,11 @@ export default {
} }
}; };
</script> </script>
<style lang="less" scoped>
.no-data {
display: block;
width: 500rpx;
height: 500rpx;
margin: 100rpx auto;
}
</style>
+123 -46
View File
@@ -7,7 +7,7 @@
</view> </view>
<view class="item acea-row row-between-wrapper"> <view class="item acea-row row-between-wrapper">
<view class="name">联系电话</view> <view class="name">联系电话</view>
<input type="text" placeholder="请输入联系电话" v-model="userAddress.phone" required :maxlength="11"/> <input type="number" placeholder="请输入联系电话" v-model="userAddress.phone" required :maxlength="11"/>
</view> </view>
<view class="item acea-row row-between-wrapper"> <view class="item acea-row row-between-wrapper">
<view class="name">所在地区</view> <view class="name">所在地区</view>
@@ -29,6 +29,31 @@
<!-- <textarea v-model="userAddress.detail" placeholder="请填写具体地址" /> --> <!-- <textarea v-model="userAddress.detail" placeholder="请填写具体地址" /> -->
</view> </view>
</view> </view>
<view class="address-analysis-wrap">
<view class="inp">
<textarea
v-model.trim="addressInput"
placeholder="请粘贴收件人手机号、姓名、收货地址并用空格区分,系统将自动识别地址信息"
placeholder-style="font-size:24rpx;color:#C2C5CC;"
class="inp-textarea"
/>
</view>
<view class="btn-wrap">
<view
class="txt"
@click="clearHandle"
>
清空
</view>
<view
:class="addressInput ? '' : 'disable'"
class="btn"
@click="distinguishHandle"
>
识别
</view>
</view>
</view>
<view class="default acea-row row-middle"> <view class="default acea-row row-middle">
<view class="select-btn"> <view class="select-btn">
<view class="checkbox-wrapper"> <view class="checkbox-wrapper">
@@ -48,71 +73,94 @@
</template> </template>
<script type="text/babel"> <script type="text/babel">
import CitySelect from "@/components/CitySelect"; import CitySelect from '@/components/CitySelect'
import config from '@/utils/mapConfig'; import config from '@/utils/mapConfig'
import {getAddress, getCity, postAddress} from "@/api/user"; import { getAddress, getCity, postAddress, analysisAddress } from '@/api/user'
import attrs, {chs_extphone, required} from "@/utils/validate"; import attrs, { chs_extphone, required } from '@/utils/validate'
import {validatorDefaultCatch} from "@/utils/dialog"; import { validatorDefaultCatch } from '@/utils/dialog'
// import { openAddress } from "@/libs/wechat"; import { isWeixin } from '@/utils'
import {isWeixin} from "@/utils"; import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "AddAddress", name: "AddAddress",
components: { components: {
CitySelect CitySelect
}, },
computed: {}, mixins: [pageListenMixins],
data() { data() {
return { return {
district: [], district: [],
id: 0, id: 0,
userAddress: {isDefault: 0}, userAddress: {
realName: '',
phone: '',
detail: '',
isDefault: 0
},
address: {}, address: {},
isWechat: isWeixin(), isWechat: isWeixin(),
addressText: "" addressText: "",
pageKeyId: Object.freeze('userAddressEdit'),
addressInput: ''
}; };
}, },
mounted: function () { mounted: function () {
let id = this.$yroute.query.id; const id = this.$yroute.query.id
this.id = id; this.id = id
if (this.id) { if (this.id) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '编辑地址' title: '编辑地址'
}) })
} }
this.getUserAddress(); this.getUserAddress()
this.getCityList(); this.getCityList()
},
watch: {
// addressText(nextModel2) {
// console.log(nextModel2, 8585858585);
// }
//定位成功后回调
// province(newVal,oldVal){
// uni.hideLoading();
// //if(newVal!=oldVal){
// this.addressText =
// this.province + " " + this.city + " " + this.county;
// this.address.province = this.province;
// this.address.city = this.city;
// this.address.district = this.county;
// this.userAddress.detail = this.detailAddress;
// //}
// }
}, },
methods: { methods: {
getIndex(value, arr) { getIndex(value, arr) {
var idx = -1; var idx = -1
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (arr[i].n == value) { if (arr[i].n == value) {
idx = i; idx = i
break; break
} }
} }
return idx; return idx
},
clearHandle() {
if (!this.addressInput) return
this.addressInput = ''
},
// 识别
distinguishHandle() {
if (!this.addressInput) return
uni.showLoading()
analysisAddress({
content: this.addressInput
}).then((res) => {
uni.hideLoading()
console.log(res)
const { success, data } = res
if (success) {
this.address = {
province: data.province || '',
city: data.city || '',
district: data.district || '',
city_id: data.cityId
}
this.userAddress.realName = data.realName || ''
this.userAddress.phone = data.phone || ''
this.userAddress.detail = data.detail || ''
this.addressText = `${this.address.province} ${this.address.city} ${this.address.district}`
}
}).catch((err) => {
uni.hideLoading()
uni.showToast({
title: err.msg + '',
icon: 'none',
mask: false,
duration: 1500
})
})
}, },
//获取当前定位地址 //获取当前定位地址
getCurAddress() { getCurAddress() {
@@ -254,8 +302,7 @@ export default {
let that = this; let that = this;
getAddress(that.id).then(res => { getAddress(that.id).then(res => {
that.userAddress = res.data; that.userAddress = res.data;
that.addressText = that.addressText = res.data.province + " " + res.data.city + " " + res.data.district;
res.data.province + " " + res.data.city + " " + res.data.district;
that.address.province = res.data.province; that.address.province = res.data.province;
that.address.city = res.data.city; that.address.city = res.data.city;
that.address.district = res.data.district; that.address.district = res.data.district;
@@ -279,11 +326,11 @@ export default {
getAddress() { getAddress() {
}, },
async submit() { async submit() {
let name = this.userAddress.realName, const name = this.userAddress.realName || ''
phone = this.userAddress.phone, const phone = this.userAddress.phone || ''
addressText = this.addressText, const addressText = this.addressText || ''
detail = this.userAddress.detail, const detail = this.userAddress.detail || ''
isDefault = this.userAddress.isDefault; const isDefault = this.userAddress.isDefault
if (phone.length < 11) { if (phone.length < 11) {
uni.showToast({ uni.showToast({
@@ -372,4 +419,34 @@ export default {
display: block; display: block;
} }
} }
.address-analysis-wrap {
padding: 20rpx;
margin: 20rpx;
border-radius: 15rpx;
background-color: #fff;
font-size: 24rpx;
.inp-textarea {
width: 100%;
height: 120rpx;
}
.btn-wrap {
display: flex;
justify-content: flex-end;
align-items: center;
margin: 20rpx 0 0 0;
.txt {
color: #999;
}
.btn {
padding: 12rpx 25rpx;
margin: 0 0 0 20rpx;
border-radius: 8rpx;
color: #fff;
background-color: #FE5261;
&.disable {
opacity: 0.75;
}
}
}
}
</style> </style>
@@ -81,11 +81,13 @@
import {getAddressDefaultSet, getAddressList, getAddressRemove} from "@/api/user"; import {getAddressDefaultSet, getAddressList, getAddressRemove} from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import {isWeixin} from "@/utils"; import {isWeixin} from "@/utils";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: { components: {
Loading Loading
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -96,7 +98,8 @@ export default {
loadTitle: "", loadTitle: "",
loading: false, loading: false,
loadend: false, loadend: false,
isWechat: isWeixin() isWechat: isWeixin(),
pageKeyId: Object.freeze('userAddressIndex')
}; };
}, },
mounted: function () { mounted: function () {
@@ -41,13 +41,14 @@
<script> <script>
import { getCommissionInfo, getSpreadInfo } from "@/api/user"; import { getCommissionInfo, getSpreadInfo } from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "CommissionDetails", name: "CommissionDetails",
components: { components: {
Loading Loading
}, },
props: {}, mixins: [pageListenMixins],
data: function() { data: function() {
return { return {
info: [], info: [],
@@ -58,7 +59,8 @@ export default {
}, },
types: 9,//3, types: 9,//3,
loaded: false, loaded: false,
loading: false loading: false,
pageKeyId: Object.freeze('userSpreadBill')
}; };
}, },
mounted: function() { mounted: function() {
+4 -2
View File
@@ -126,13 +126,14 @@
<script> <script>
import {getSpreadUser} from "@/api/user"; import {getSpreadUser} from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "PromoterList", name: "PromoterList",
components: { components: {
Loading Loading
}, },
props: {}, mixins: [pageListenMixins],
data: function () { data: function () {
return { return {
fixedState: false, fixedState: false,
@@ -153,7 +154,8 @@ export default {
loadTitle: "", loadTitle: "",
first: "", first: "",
second: "", second: "",
webUrl: this.$VUE_APP_RESOURCES_URL webUrl: this.$VUE_APP_RESOURCES_URL,
pageKeyId: Object.freeze('userSpreadStat')
}; };
}, },
mounted: function () { mounted: function () {
+34 -23
View File
@@ -10,7 +10,7 @@
</view> </view>
</view> </view>
<view class="" style="flex-grow: 1;font-size: 24rpx;"> <view class="" style="flex-grow: 1;font-size: 24rpx;">
返佣说明1.下线客户下单成功后平台设置为默认7天收货成功佣金便自动计算添加到上线的返佣2.如过程中下单客户有退货退款则此订单返佣无效会自动取消或相应扣除 {{ ruleText }}
</view> </view>
</view> </view>
</view> </view>
@@ -60,14 +60,15 @@
</view> </view>
</template> </template>
<script> <script>
import { getSpreadOrder } from "@/api/user"; import { getSpreadOrder, getUserSpreadRule } from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "PromoterOrder", name: "PromoterOrder",
components: { components: {
Loading Loading
}, },
props: {}, mixins: [pageListenMixins],
data: function() { data: function() {
return { return {
list: [], list: [],
@@ -77,39 +78,49 @@ export default {
}, },
loaded: false, loaded: false,
loading: false, loading: false,
loadTitle: "", loadTitle: '',
count: "" count: '',
}; ruleText: '',
pageKeyId: Object.freeze('userSpreadOrder')
}
}, },
mounted: function() { mounted() {
this.getIndex(); this.getIndex()
this.getRuleText()
}, },
onReachBottom() { onReachBottom() {
!this.loading && this.getIndex(); !this.loading && this.getIndex()
}, },
methods: { methods: {
getIndex: function() { getRuleText() {
let there = this; getUserSpreadRule().then(res => {
if (there.loaded == true || there.loading == true) return; const { success, data } = res
there.loading = true; if (success) {
this.ruleText = data.userSpreadRule || ''
}
})
},
getIndex() {
let there = this
if (there.loaded == true || there.loading == true) return
there.loading = true
getSpreadOrder(there.where).then( getSpreadOrder(there.where).then(
res => { res => {
there.loading = false; there.loading = false
there.loaded = res.data.list.length < there.where.limit; there.loaded = res.data.list.length < there.where.limit
there.loadTitle = there.loaded ? "人家是有底线的" : "上拉加载更多"; there.loadTitle = there.loaded ? "人家是有底线的" : "上拉加载更多"
there.where.page = there.where.page + 1; there.where.page = there.where.page + 1
there.list.push.apply(there.list, res.data.list); there.list.push.apply(there.list, res.data.list)
there.count = res.data.count; there.count = res.data.count
}, },
err => { err => {
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message, title: err.msg || err.response.data.msg|| err.response.data.message,
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); })
}, }
300 )
);
} }
} }
}; };
+4 -3
View File
@@ -100,11 +100,11 @@
import { getSpreadInfo } from "@/api/user"; import { getSpreadInfo } from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "UserPromotion", name: "UserPromotion",
components: {}, mixins: [pageListenMixins],
props: {},
data: function() { data: function() {
return { return {
Info: { Info: {
@@ -112,7 +112,8 @@ export default {
extractCount: 0, extractCount: 0,
commissionCount: 0 commissionCount: 0
}, },
webUrl:this.$VUE_APP_RESOURCES_URL webUrl:this.$VUE_APP_RESOURCES_URL,
pageKeyId: Object.freeze('userSpreadIndex')
}; };
}, },
mounted: function() { mounted: function() {
+57 -4
View File
@@ -421,18 +421,21 @@ import {
getHotelGoodList, getHotelGoodList,
postHotelNewsDel, postHotelNewsDel,
setTopHotelNew, setTopHotelNew,
getHotelNewsZan getHotelNewsZan,
getHotelShareBackgroundImage
} from "@/api/inn.js" } from "@/api/inn.js"
import {formatDateTime} from "@/utils" import {formatDateTime} from "@/utils"
import {getUrlParam} from "@/utils/common.js" import {getUrlParam} from "@/utils/common.js"
import imgBox from '@/components/imageTypeSet/imagebox.vue' import imgBox from '@/components/imageTypeSet/imagebox.vue'
import cookie from "@/utils/store/cookie" import cookie from "@/utils/store/cookie"
import {addStore, removeStore} from "@/api/favorite" import {addStore, removeStore} from "@/api/favorite"
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: { components: {
imgBox imgBox
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -469,7 +472,9 @@ export default {
{ text: '商家资质', value: 3, isShow: true } { text: '商家资质', value: 3, isShow: true }
], ],
isLoadGoodListoSuccess: false, isLoadGoodListoSuccess: false,
isLoadInfoListSuccess: false isLoadInfoListSuccess: false,
pageKeyId: '',
shareImg: ''
} }
}, },
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景 // 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
@@ -477,8 +482,43 @@ export default {
this.scrollData = e this.scrollData = e
}, },
onLoad(options) { onLoad(options) {
if (options.id) { const id = options.id || ''
this.id = options.id || null const from = options.from
switch (from) {
// 特产
case 'techan':
this.pageKeyId = `hotel_from_techan_hotelId_${id}`
break
// 千县
case 'famous':
this.pageKeyId = `hotel_from_famous_hotelId_${id}`
break
// 特色礼品
case 'gift':
this.pageKeyId = `hotel_from_gift_hotelId_${id}`
break
// 文玩
case 'wenwan':
this.pageKeyId = `hotel_from_wenwan_hotelId_${id}`
break
// 寻趣味
case 'fun':
this.pageKeyId = `hotel_from_findFun_hotelId_${id}`
break
// 养生圣地
case 'wellness':
this.pageKeyId = `hotel_from_wellnessPlace_hotelId_${id}`
break
// 民宿
case 'homestay':
this.pageKeyId = `product_from_countyFamous_productId_${id}`
break
default:
this.pageKeyId = `hotel_from_common_hotelId_${id}`
break
}
if (id) {
this.id = id || null
this.partnerId = options.partnerId || null this.partnerId = options.partnerId || null
} else { } else {
let obj = uni.getEnterOptionsSync() let obj = uni.getEnterOptionsSync()
@@ -499,6 +539,19 @@ export default {
this.picColumnWidth = (e.screenWidth - uni.upx2px(92)) / 2 + 'px' this.picColumnWidth = (e.screenWidth - uni.upx2px(92)) / 2 + 'px'
} }
}) })
getHotelShareBackgroundImage(this.id).then(res => {
const { success, data } = res
if (success) {
this.shareImg = data
}
})
},
onShareAppMessage() {
return {
title: this.inn.name,
path: '/pagesInn/inn/innHome?id=' + this.inn.id,
imageUrl: this.shareImg
}
}, },
onShow() { onShow() {
if (!this.isLoad) { if (!this.isLoad) {
+58 -1
View File
@@ -136,6 +136,14 @@
</view> </view>
</view> </view>
</view> --> </view> -->
<view class="item is_required">
<view class="cell acea-row row-between row-middle">
<view class="cell-title">
店铺图片
<text class="txt">最多上传9张图片</text>
</view>
</view>
</view>
<view v-if="picsArray.length > 0" class="item"> <view v-if="picsArray.length > 0" class="item">
<view class="img-upload"> <view class="img-upload">
<tm-upload <tm-upload
@@ -148,6 +156,26 @@
/> />
</view> </view>
</view> </view>
<view class="item is_required">
<view class="cell acea-row row-between row-middle">
<view class="cell-title">
店铺资质
<text class="txt">最多上传9张图片</text>
</view>
</view>
</view>
<view v-if="picsArray.length > 0" class="item">
<view class="img-upload">
<tm-upload
:dataList="qualificationsArray"
:upload_img_wh="(750 - 3 * 16 - 2 * 32) / 3.0"
:upload_max="10"
:url="uploadUrl"
:header="uploadHeader"
@change="uploadedImg2Change"
/>
</view>
</view>
</view> </view>
<view class="submit-btn" @tap="submit">确定修改</view> <view class="submit-btn" @tap="submit">确定修改</view>
</view> </view>
@@ -176,10 +204,12 @@ export default {
}, },
innHistory: {}, // 历史信息 innHistory: {}, // 历史信息
picsArray: [], picsArray: [],
qualificationsArray: [],
typeList: [], // 类型列表 typeList: [], // 类型列表
typeIndex: 0, // 选中的类型 typeIndex: 0, // 选中的类型
typeRange: [], // 类型数据源 typeRange: [], // 类型数据源
uploadedFilesArray: [], uploadedFilesArray: [],
uploadedQualificationFilesArray: [],
innApplyInfo: { innApplyInfo: {
'address': '', 'address': '',
'areaId': 0, 'areaId': 0,
@@ -193,6 +223,7 @@ export default {
'name': '', 'name': '',
'ownerName': '', 'ownerName': '',
'pics': [], 'pics': [],
'qualification': [],
'position': '', 'position': '',
'tel': '', 'tel': '',
'qrcode': '', 'qrcode': '',
@@ -209,6 +240,7 @@ export default {
if (id) { if (id) {
// 赋值 // 赋值
const hotel = JSON.parse(uni.getStorageSync('MY_HOTEL_INFO')) const hotel = JSON.parse(uni.getStorageSync('MY_HOTEL_INFO'))
console.log(hotel)
this.innHistory = hotel this.innHistory = hotel
this.fillData(this.innApplyInfo, this.innHistory) this.fillData(this.innApplyInfo, this.innHistory)
if (hotel.coverType === 2) { if (hotel.coverType === 2) {
@@ -216,7 +248,7 @@ export default {
} else { } else {
this.innApplyInfo.coverVideo = '' this.innApplyInfo.coverVideo = ''
} }
// 图片填充 // 店铺图片
this.picsArray = hotel.pics.map(item => { this.picsArray = hotel.pics.map(item => {
return { return {
path: item, path: item,
@@ -224,6 +256,17 @@ export default {
} }
}) })
this.uploadedFilesArray = hotel.pics || [] this.uploadedFilesArray = hotel.pics || []
// 资质
const uploadedQualificationFilesArray = []
this.qualificationsArray = hotel.qualifications.map(item => {
const image = item.image || ''
uploadedQualificationFilesArray.push(image)
return {
path: item.image,
upload_percent: 100
}
})
this.uploadedQualificationFilesArray = uploadedQualificationFilesArray
} }
}, },
methods: { methods: {
@@ -261,6 +304,10 @@ export default {
uploadedImgChange: function (uploadedFilesList) { uploadedImgChange: function (uploadedFilesList) {
this.uploadedFilesArray = uploadedFilesList this.uploadedFilesArray = uploadedFilesList
}, },
// 文件上传结果
uploadedImg2Change: function (uploadedFilesList) {
this.uploadedQualificationFilesArray = uploadedFilesList
},
chooseQrcodeImg() { chooseQrcodeImg() {
chooseImage(img => { chooseImage(img => {
this.$set(this.innApplyInfo, 'qrcode', img) this.$set(this.innApplyInfo, 'qrcode', img)
@@ -311,11 +358,16 @@ export default {
this.$dialog.error('请上传至少一张店铺图片') this.$dialog.error('请上传至少一张店铺图片')
return return
} }
if (this.uploadedQualificationFilesArray.length === 0) {
this.$dialog.error('请上传至少一张店铺资质图片')
return
}
// 深拷贝 // 深拷贝
const param = JSON.parse(JSON.stringify(this.innApplyInfo)) const param = JSON.parse(JSON.stringify(this.innApplyInfo))
if (this.uploadedFilesArray.length > 0) { if (this.uploadedFilesArray.length > 0) {
param.pics = this.uploadedFilesArray.join(',') param.pics = this.uploadedFilesArray.join(',')
} }
param.qualification = this.uploadedQualificationFilesArray
param.id = this.innHistory.id param.id = this.innHistory.id
if (param.coverType === 2) { if (param.coverType === 2) {
param.cover = param.coverVideo param.cover = param.coverVideo
@@ -430,6 +482,11 @@ export default {
flex-shrink: 0; flex-shrink: 0;
margin-right: 10rpx; margin-right: 10rpx;
} }
.base-info-section .item.is_required .cell .cell-title .txt {
margin: 0 0 0 8px;
color: red;
font-size: 22rpx;
}
.base-info-section .item.is_required .cell .cell-value { .base-info-section .item.is_required .cell .cell-value {
flex-grow: 1; flex-grow: 1;
+8 -5
View File
@@ -37,14 +37,17 @@
</template> </template>
<script> <script>
import {getLogs, takePrize} from "@/api/lottery"; import {getLogs, takePrize} from '@/api/lottery'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
loading: false, loading: false,
page: 1, page: 1,
list: [] list: [],
pageKeyId: Object.freeze('lotteryRecords')
} }
}, },
onShow() { onShow() {
@@ -98,15 +101,15 @@ export default {
confirmText: '查看订单', confirmText: '查看订单',
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
console.log('用户点击确定'); console.log('用户点击确定')
uni.navigateTo({ uni.navigateTo({
url: '/pages/order/MyOrder/index' url: '/pages/order/MyOrder/index'
}) })
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消'); console.log('用户点击取消')
} }
} }
}); })
} }
} }
} }
+16 -2
View File
@@ -80,11 +80,13 @@
</template> </template>
<script> <script>
import { getDetail, getPrize, takePrize } from '@/api/lottery' import { getDetail, getPrize, takePrize, getLotteryShareInfo } from '@/api/lottery'
import gbroMarquee from '../components/gbro-marquee/marquee.vue' import gbroMarquee from '../components/gbro-marquee/marquee.vue'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: { gbroMarquee }, components: { gbroMarquee },
mixins: [pageListenMixins],
data() { data() {
return { return {
ready: false, ready: false,
@@ -113,7 +115,9 @@ export default {
text_color: "#333", //字体颜色 text_color: "#333", //字体颜色
back_color: "red", //背景色 back_color: "red", //背景色
}, },
imgData: [] imgData: [],
shareAppImg: '',
pageKeyId: Object.freeze('lotteryIndex')
} }
}, },
computed: { computed: {
@@ -126,6 +130,13 @@ export default {
onLoad() { onLoad() {
this.init() this.init()
}, },
onShareAppMessage() {
return {
title: '探寻有趣有味的生活方式',
path: '/pkg-video/views/lottery',
imageUrl: this.shareAppImg
}
},
methods: { methods: {
init() { init() {
getDetail().then(res => { getDetail().then(res => {
@@ -138,6 +149,9 @@ export default {
},1000) },1000)
} }
}) })
getLotteryShareInfo().then(res => {
this.shareAppImg = res.data || ''
})
}, },
onSubmit() { onSubmit() {
+7 -3
View File
@@ -3,15 +3,19 @@
</template> </template>
<script> <script>
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "pdf", mixins: [pageListenMixins],
name: 'PdfView',
data() { data() {
return { return {
pdfPath: "" pdfPath: '',
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.pdfPath = options.path; this.pageKeyId = `investmentInfo_id_${options.id}`
this.pdfPath = options.path
} }
} }
</script> </script>
+10 -2
View File
@@ -32,8 +32,16 @@
<view class="footer flex jc-between ai-end"> <view class="footer flex jc-between ai-end">
<image :src="webUrl+'/20221014095236624035.png'" @click="getUploadToken"></image> <image :src="webUrl+'/20221014095236624035.png'" @click="getUploadToken"></image>
<view class="input-box"> <view class="input-box">
<textarea v-model="content" maxlength="150" :auto-height="true" :fixed="true" confirm-type="send" <textarea
@input="userInput" @confirm="userSend"/> v-model="content"
maxlength="150"
:auto-height="true"
:fixed="true"
:show-confirm-bar="false"
confirm-type="send"
@input="userInput"
@confirm="userSend"
/>
</view> </view>
<button @click="userSend">发送</button> <button @click="userSend">发送</button>
</view> </view>
+59 -55
View File
@@ -1,97 +1,101 @@
<template> <template>
<view class="pkg-join-index"> <view class="pkg-join-index">
<image class="img-banner" :src="images.topImage" mode="scaleToFill"/> <image
:src="images.topImage"
<!-- <view class="box flex flex-col ai-center">--> class="img-banner"
<!-- <image class="img-title" :src="webUrl+'/20230413103123003753.png'" mode="scaleToFill"/>--> mode="scaleToFill"
<!-- </view>--> />
<image
<image class="img-item" mode="widthFix" :src="images.goodSupplierImage" v-show="partnerType === 'province_partner' || partnerType === ''"
@click="goto('goods_supplier')" v-show="partnerType==='province_partner'||partnerType===''"/> :src="images.goodSupplierImage"
<image class="img-item" mode="widthFix" :src="images.wenwanSupplierImage" class="img-item"
@click="goto('wenwan_supplier')" v-show="partnerType==='pioneer'||partnerType===''"/> mode="widthFix"
<image class="img-item" mode="widthFix" :src="images.hotelImage" @click="goto('goods_supplier')"
@click="goto('shop')" v-show="partnerType==='pioneer'||partnerType===''"/> />
<image class="img-item" mode="widthFix" :src="images.wholesalerImage" @click="goto('wholesaler')"/> <image
v-show="partnerType === 'pioneer' || partnerType === ''"
:src="images.wenwanSupplierImage"
class="img-item"
mode="widthFix"
@click="goto('wenwan_supplier')"
/>
<image
v-show="partnerType === 'pioneer' || partnerType === ''"
:src="images.hotelImage"
class="img-item"
mode="widthFix"
@click="goto('shop')"
/>
<image
:src="images.wholesalerImage"
class="img-item"
mode="widthFix"
@click="goto('wholesaler')"
/>
</view> </view>
</template> </template>
<script> <script>
import {getImages, getShopData} from "@/api/join"; import { getImages, getShopData } from '@/api/join'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "pkgJoinIndex", name: 'PkgJoinIndex',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
partnerId: "", partnerId: '',
partnerType: "", partnerType: '',
hotelId: null, hotelId: null,
hasHotel: null, hasHotel: null,
hasSupplier: null, hasSupplier: null,
hasWholesaler: null, hasWholesaler: null,
images: null images: null,
pageKeyId: Object.freeze('merchantApplyIndex')
} }
}, },
onLoad(options) { onLoad(options) {
this.partnerId = options.partnerId || ""; this.partnerId = options.partnerId || ''
getImages().then(({data}) => this.images = data); getImages().then(({data}) => this.images = data)
getShopData(this.partnerId).then(({data}) => { getShopData(this.partnerId).then(({data}) => {
this.partnerType = data.partnerType; this.partnerType = data.partnerType
this.hotelId = data.hotelId; this.hotelId = data.hotelId
this.hasHotel = data.hasHotel; this.hasHotel = data.hasHotel
this.hasSupplier = data.hasSupplier; this.hasSupplier = data.hasSupplier
this.hasWholesaler = data.hasWholesaler; this.hasWholesaler = data.hasWholesaler
}) })
}, },
methods: { methods: {
goto(target) { goto(target) {
switch (target) { switch (target) {
case "goods_supplier": case 'goods_supplier':
if (this.hasSupplier === 1) { if (this.hasSupplier === 1) {
this.$global.goSupplierMini(); this.$global.goSupplierMini()
// uni.showToast({
// title: "您已成为供应商/员工,无需重复申请",
// icon: "none"
// })
} else { } else {
this.$yrouter.push(`/pkg_join/views/supplier?type=goods_supplier&partnerId=${this.partnerId}`) this.$yrouter.push(`/pkg_join/views/supplier?type=goods_supplier&partnerId=${this.partnerId}`)
} }
break; break
case "wenwan_supplier": case 'wenwan_supplier':
if (this.hasSupplier === 1) { if (this.hasSupplier === 1) {
this.$global.goSupplierMini(); this.$global.goSupplierMini()
// uni.showToast({
// title: "您已成为供应商/员工,无需重复申请",
// icon: "none"
// })
} else { } else {
this.$yrouter.push(`/pkg_join/views/supplier?type=wenwan_supplier&partnerId=${this.partnerId}`) this.$yrouter.push(`/pkg_join/views/supplier?type=wenwan_supplier&partnerId=${this.partnerId}`)
} }
break; break
case "shop": case 'shop':
if (this.hasHotel === 1) { if (this.hasHotel === 1) {
// uni.showToast({ this.$yrouter.push('/pagesInn/inn/innHome?id='+this.hotelId)
// title: "您已开通店铺,无需重复申请",
// icon: "none"
// })
this.$yrouter.push("/pagesInn/inn/innHome?id="+this.hotelId)
} else { } else {
this.$yrouter.push('/pkg_join/views/shop?partnerId=' + this.partnerId) this.$yrouter.push('/pkg_join/views/shop?partnerId=' + this.partnerId)
} }
break; break
case "wholesaler": case 'wholesaler':
if (this.hasWholesaler === 1) { if (this.hasWholesaler === 1) {
this.$global.goSupplierMini(); this.$global.goSupplierMini()
// uni.showToast({
// title: "您已成为采购批发商,无需重复申请",
// icon: "none"
// })
} else { } else {
this.$yrouter.push(`/pkg_join/views/wholesaler`) this.$yrouter.push(`/pkg_join/views/wholesaler`)
} }
break; break
} }
} }
} }
+294 -202
View File
@@ -1,18 +1,37 @@
<template> <template>
<u--form :model="form" errorType="toast" labelWidth="216rpx" ref="shopForm"> <u--form
<view class="box-state" v-if="stateTitle && isDraft!==1"> ref="shopForm"
<u-alert :center="stateType==='primary'" :title="stateTitle" :type="stateType"/> :model="form"
errorType="toast"
labelWidth="216rpx"
>
<view
v-if="stateTitle && isDraft !== 1"
class="box-state"
>
<u-alert
:center="stateType === 'primary'"
:title="stateTitle"
:type="stateType"
/>
</view> </view>
<u-cell-group
<u-cell-group title="店铺基本信息" :border="false" :customStyle="{'fontSize':'40rpx'}"> :border="false"
:customStyle="{'fontSize':'40rpx'}"
title="店铺基本信息"
>
<u-form-item prop="name"> <u-form-item prop="name">
<u-cell title="店铺名称" :border="false"> <u-cell title="店铺名称" :border="false">
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
</template> </template>
<template #value> <template #value>
<u-input v-model="form.name" border="none" placeholder="请填写店铺名称"/> <u-input
v-model="form.name"
:disabled="reviewing"
border="none"
placeholder="请填写店铺名称"
/>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
@@ -24,6 +43,7 @@
<template #value> <template #value>
<u-radio-group <u-radio-group
v-model="form.coverType" v-model="form.coverType"
:disabled="reviewing"
placement="row" placement="row"
> >
<u-radio <u-radio
@@ -94,22 +114,21 @@
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="pics"> <u-form-item prop="pics">
<u-cell title="店铺图片" :border="false"> <u-cell title="店铺图片" :border="false">
<template #label> <template #label>
<u-upload <u-upload
:fileList="pics" :fileList="pics"
@afterRead="afterRead" :maxCount="9"
@delete="deletePic" :disabled="reviewing"
name="pics" name="pics"
multiple multiple
:maxCount="9" @afterRead="afterRead"
></u-upload> @delete="deletePic"
/>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="logo"> <u-form-item prop="logo">
<u-cell title="店铺logo" :border="false"> <u-cell title="店铺logo" :border="false">
<template #icon> <template #icon>
@@ -119,13 +138,19 @@
<u-cell :border="false"> <u-cell :border="false">
<template #title> <template #title>
<view class="box-upload" @click="chooseLogoImg('logo')"> <view class="box-upload" @click="chooseLogoImg('logo')">
<view class="btn-upload" v-if="form.logo.length===0 || form.logo==null">上传图片</view> <view
<image class="img-preview" :src="form.logo" v-else/> v-if="!form.logo"
class="btn-upload"
>上传图片</view>
<image
v-else
:src="form.logo"
class="img-preview"
/>
</view> </view>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<view class="full-title"> <view class="full-title">
<u-cell :border="false"> <u-cell :border="false">
<template #title> <template #title>
@@ -137,54 +162,69 @@
</template> </template>
<template #label> <template #label>
<u-upload <u-upload
:fileList="quaPics" :maxCount="9"
@afterRead="quaAfterRead" :fileList="quaPics"
@delete="quaDeletePic" :disabled="reviewing"
name="quaPics" name="quaPics"
multiple multiple
:maxCount="9" @afterRead="quaAfterRead"
></u-upload> @delete="quaDeletePic"
/>
</template> </template>
</u-cell> </u-cell>
</view> </view>
<u-form-item prop="typeText"> <u-form-item prop="typeText">
<u-cell title="店铺类型" :border="false" isLink @click="changeType(true)"> <u-cell title="店铺类型" :border="false" isLink>
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
</template> </template>
<template #value> <template #value>
<u--text :text="form.typeText" v-if="form.typeText"></u--text> <picker
<u--text text="请选择类型" color="#c0c4cc" v-else></u--text> :value="indexType"
:range="columnsType"
:disabled="reviewing"
mode=selector
range-key="name"
class="picker"
@change="typeChange"
>
<u--text v-if="form.typeText" :text="form.typeText"></u--text>
<u--text v-else text="请选择类型" color="#c0c4cc"></u--text>
</picker>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-picker :show="showType" :defaultIndex="indexType" :columns="columnsType" keyName="name"
@confirm="confirmType" @cancel="cancelType"/>
<u-form-item prop="contact"> <u-form-item prop="contact">
<u-cell title="联系人姓名" :border="false"> <u-cell title="联系人姓名" :border="false">
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
</template> </template>
<template #value> <template #value>
<u-input v-model="form.contact" border="none" placeholder="请填写姓名"/> <u-input
v-model="form.contact"
:disabled="reviewing"
border="none"
placeholder="请填写姓名"
/>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="phone"> <u-form-item prop="phone">
<u-cell title="联系方式" :border="false"> <u-cell title="联系方式" :border="false">
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
</template> </template>
<template #value> <template #value>
<u-input v-model="form.phone" border="none" placeholder="请填写联系方式"/> <u-input
v-model="form.phone"
:disabled="reviewing"
type="number"
border="none"
placeholder="请填写联系方式"
/>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="captcha"> <u-form-item prop="captcha">
<u-cell title="验证码" :border="false"> <u-cell title="验证码" :border="false">
<template #icon> <template #icon>
@@ -193,9 +233,14 @@
<template #value> <template #value>
<view class="captcha-wrap"> <view class="captcha-wrap">
<view class="captcha-wrap-input"> <view class="captcha-wrap-input">
<u-input v-model="form.captcha" border="none" placeholder="请填写验证码" /> <u-input
v-model="form.captcha"
:disabled="reviewing"
border="none"
placeholder="请填写验证码"
/>
</view> </view>
<view class="captcha-wrap-ft"> <view v-if="!reviewing" class="captcha-wrap-ft">
<u-code <u-code
ref="uCode" ref="uCode"
seconds="30" seconds="30"
@@ -213,7 +258,6 @@
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="area"> <u-form-item prop="area">
<u-cell title="省市区" :border="false" isLink> <u-cell title="省市区" :border="false" isLink>
<template #icon> <template #icon>
@@ -221,74 +265,99 @@
</template> </template>
<template #value> <template #value>
<view class="u-text__value" :class="{'area-item':form.area.length===0}"> <view class="u-text__value" :class="{'area-item':form.area.length===0}">
<CitySelect ref="cityselect" :defaultValue="form.area" @callback="result" :items="district"/> <CitySelect
ref="cityselect"
:defaultValue="form.area"
:disabled="reviewing"
:items="district"
@callback="result"
/>
</view> </view>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="address"> <u-form-item prop="address">
<u-cell title="详细地址" :border="false"> <u-cell title="详细地址" :border="false">
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
</template> </template>
<template #value> <template #value>
<u-input v-model="form.address" border="none" placeholder="请填写详细地址"/> <u-input
v-model="form.address"
:disabled="reviewing"
border="none"
placeholder="请填写详细地址"
/>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="position"> <u-form-item prop="position">
<u-cell title="地理定位选择" :border="false" isLink @click="chooLocation"> <u-cell
title="地理定位选择"
:border="false"
isLink
@click="chooLocation"
>
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
</template> </template>
<template #value> <template #value>
<u--text :text="form.position" v-if="form.position"></u--text> <u--text v-if="form.position" :text="form.position"></u--text>
<u--text text="请选择" color="#c0c4cc" v-else></u--text> <u--text v-else text="请选择" color="#c0c4cc"></u--text>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="content"> <u-form-item prop="content">
<u-cell title="一句话介绍" :border="false"> <u-cell title="一句话介绍" :border="false">
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
</template> </template>
</u-cell> </u-cell>
<view class="content-section"> <view class="content-section">
<u-cell :border="false"> <u-cell :border="false">
<template #title> <template #title>
<view class="line"> <view class="line">
<u-input v-model="form.content" border="none" placeholder="请填写一句话..."/> <u-input
v-model="form.content"
:disabled="reviewing"
border="none"
placeholder="请填写一句话..."
/>
</view> </view>
</template> </template>
</u-cell> </u-cell>
</view> </view>
</u-form-item> </u-form-item>
<view style="height: 100rpx;width: 100%;"></view> <view style="height: 100rpx;width: 100%;"></view>
<!-- <u-form-item prop="desc">
<view class="content-section">
<u-cell title="店铺简介" :border="false">
<template #label>
<view class="line">
<u--textarea v-model="form.desc" border="none" placeholder="请填写店铺简介..."></u--textarea>
</view>
</template>
</u-cell>
</view>
</u-form-item> -->
</u-cell-group> </u-cell-group>
<view class="btn-submit btn-remove" v-if="reviewStatus===0 && isDraft!==1" @click="changeRemove(true)">撤销申请</view> <view
<view class="btn-submit" @click="onSubmit" v-else>提交申请</view> v-if="reviewStatus === 0 && isDraft !== 1"
class="btn-submit btn-remove"
<u-modal :show="showRemove" content="您确定撤销申请吗?" showCancelButton @cancel="changeRemove(false)" @click="changeRemove(true)"
@confirm="onRemove"></u-modal> >
撤销申请
<u-popup :show="show" mode="center" round="10" closeable @close="show=false"> </view>
<view
v-else
class="btn-submit"
@click="onSubmit"
>
提交申请
</view>
<u-modal
:show="showRemove"
content="您确定撤销申请吗?"
showCancelButton
@cancel="changeRemove(false)"
@confirm="onRemove"
/>
<u-popup
:show="show"
mode="center"
round="10"
closeable
@close="show=false"
>
<view class="popup-body"> <view class="popup-body">
<view class="tc bold">入驻申请须知</view> <view class="tc bold">入驻申请须知</view>
<view class="content"> <view class="content">
@@ -302,42 +371,49 @@
<text>我已仔细阅读并同意</text> <text>我已仔细阅读并同意</text>
</checkbox-group> </checkbox-group>
</view> </view>
<u-button type="error" text="确定" :disabled="!isAgree" @click="save"></u-button> <u-button
type="error"
text="确定"
:disabled="!isAgree"
@click="save"
/>
</view> </view>
</u-popup> </u-popup>
</u--form> </u--form>
</template> </template>
<script> <script>
import CitySelect from "@/components/CitySelect" import CitySelect from '@/components/CitySelect'
import { pageListenMixins } from '@/mixins/pageListenMixins'
import { import {
getShopData, getShopData,
getShopInfo, getShopInfo,
removeApply, removeApply,
saveShop saveShop
} from "@/api/join" } from '@/api/join'
import { import {
getCity, getCity,
registerVerify registerVerify
} from "@/api/user" } from '@/api/user'
import { import {
chooseImage, chooseImage,
moreImage, moreImage,
uploadImage, uploadImage,
chooseVideoToUpload chooseVideoToUpload
} from "@/utils" } from '@/utils'
export default { export default {
name: "PkgJoinShop", name: 'PkgJoinShop',
components: { components: {
CitySelect CitySelect
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
partnerId: null, partnerId: null,
pics: [], pics: [],
quaPics: [], quaPics: [],
tips: '', tips: '获取验证码',
form: { form: {
name: '', name: '',
cover: '', cover: '',
@@ -428,7 +504,6 @@ export default {
trigger: ['blur', 'change'] trigger: ['blur', 'change']
} }
}, },
showType: false,
columnsType: [], columnsType: [],
indexType: [0], indexType: [0],
district: [], district: [],
@@ -441,147 +516,164 @@ export default {
reviewStatus: null, reviewStatus: null,
stateTitle: '', stateTitle: '',
stateType: 'primary', stateType: 'primary',
isPass: false // 是否为审核中
reviewing: false,
pageKeyId: Object.freeze('merchantApplyHotel')
} }
}, },
onLoad(options) { onLoad(options) {
this.partnerId = options.partnerId; this.partnerId = options.partnerId
this.init(); this.init()
}, },
onReady() { onReady() {
this.$refs.shopForm.setRules(this.rules); this.$refs.shopForm.setRules(this.rules)
}, },
methods: { methods: {
changeType(state){
this.showType=state
},
changeRemove(state){ changeRemove(state){
this.showRemove=state this.showRemove = state
}, },
codeChange(text) { codeChange(text) {
this.tips = text; this.tips = text
}, },
getCode() { getCode() {
if (this.form.phone.length === 0) return; if (this.reviewing) return
if (this.form.phone.length === 0) {
uni.$u.toast('请输入位手机号')
return
}
if (this.form.phone.length !== 11) {
uni.$u.toast('请输入11位手机号')
return
}
if (this.$refs.uCode.canGetCode) { if (this.$refs.uCode.canGetCode) {
uni.showLoading({ uni.showLoading({
title: '正在获取验证码' title: '正在获取验证码'
}) })
registerVerify({phone: this.form.phone, type: "merchantApply"}).then(() => { registerVerify({
uni.hideLoading(); phone: this.form.phone,
type: 'merchantApply'
}).then(() => {
uni.hideLoading()
// 这里此提示会被this.start()方法中的提示覆盖 // 这里此提示会被this.start()方法中的提示覆盖
uni.$u.toast('验证码已发送'); uni.$u.toast('验证码已发送')
// 通知验证码组件内部开始倒计时 // 通知验证码组件内部开始倒计时
this.$refs.uCode.start(); this.$refs.uCode.start()
}).catch(err => { }).catch(err => {
uni.hideLoading(); uni.hideLoading()
uni.$u.toast(err.msg); uni.$u.toast(err.msg)
}) })
} else { } else {
uni.$u.toast('倒计时结束后再发送'); uni.$u.toast('倒计时结束后再发送')
} }
}, },
init() { init() {
getCity().then(({data}) => { getCity().then(({data}) => {
this.district = data; this.district = data
}); })
getShopData().then(({data}) => { getShopData().then(({data}) => {
this.columnsType.push(data.hotelTypeList); this.columnsType = data.hotelTypeList
this.notice = data.merchantApplyNotice; this.notice = data.merchantApplyNotice
this.initInfo(); this.initInfo()
}); })
}, },
initInfo() { initInfo() {
getShopInfo().then(({data}) => { getShopInfo().then(({data}) => {
if (data.partnerId != null) { if (data.partnerId != null) {
this.partnerId = data.partnerId; this.partnerId = data.partnerId
} }
this.isDraft = data.isDraft; this.isDraft = data.isDraft
this.reviewStatus = data.reviewStatus; this.reviewStatus = data.reviewStatus
switch (data.reviewStatus) { switch (data.reviewStatus) {
case 0: case 0:
this.stateTitle = "审核中"; this.stateTitle = '审核中'
this.stateType = "primary"; this.stateType = 'primary'
break; this.reviewing = true
break
case 1: case 1:
this.isPass = true; this.reviewing = false
break; break
case 2: case 2:
this.stateTitle = "审核驳回:" + data.reviewMsg; this.stateTitle = '审核驳回:' + data.reviewMsg
this.stateType = "error"; this.stateType = 'error'
break; this.reviewing = false
break
} }
if (data.hotelInfo) { if (data.hotelInfo) {
this.pics = []; // 店铺图片
this.form = data.hotelInfo; this.pics = []
let temp = this.form.pics.split(","); this.form = data.hotelInfo
if (temp.length > 0) { const picsTemp = this.form.pics.split(',')
temp.map(item => { if (picsTemp.length > 0) {
if (item.length > 0) { picsTemp.map(item => {
if (item) {
this.pics.push({url: item}) this.pics.push({url: item})
} }
}) })
} }
this.indexType = this.columnsType[0].findIndex(item => item.id === this.form.type); // 商家资质
if (this.indexType != -1) { this.quaPics = []
this.form.typeText = this.columnsType[0][this.indexType].name; const quaPicsTemp = this.form.qualification.split(',')
if (quaPicsTemp.length > 0) {
quaPicsTemp.map(item => {
if (item) {
this.quaPics.push({url: item})
}
})
} }
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6); this.indexType = this.columnsType.findIndex(item => item.id === this.form.type)
this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`; if (this.indexType !== -1) {
this.form.typeText = this.columnsType[this.indexType].name
}
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6)
this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`
} }
}); })
}, },
chooseLogoImg(target) { chooseLogoImg(target) {
if (this.reviewing) return
chooseImage(img => { chooseImage(img => {
this.form[target] = img; this.form[target] = img
}); })
}, },
chooseLogoVideo() { chooseLogoVideo() {
if (this.reviewing) return
chooseVideoToUpload(path => { chooseVideoToUpload(path => {
this.form.coverVideo = path this.form.coverVideo = path
this.$forceUpdate() this.$forceUpdate()
}) })
}, },
chooseShopImg() { chooseShopImg() {
let that = this; if (this.reviewing) return
let count = 0; const _this = this
let count = 0
moreImage(9, (img, total) => { moreImage(9, (img, total) => {
if (img) that.pics.push(img); if (img) {
count++; _this.pics.push(img)
count++
}
if (count === total) { if (count === total) {
that.form.pics = that.pics.join(","); _this.form.pics = _this.pics.join(',')
} }
}) })
}, },
// 删除图片 // 删除图片
deletePic(event) { deletePic(event) {
this[`${event.name}`].splice(event.index, 1) this[`${event.name}`].splice(event.index, 1)
}, },
afterRead(event) { afterRead(event) {
let that = this; const _this = this
if (event.file.length > 0) { if (event.file.length > 0) {
event.file.map(item => { event.file.map(item => {
uploadImage(item.url, img => { uploadImage(item.url, img => {
that.pics.push({url: img}) _this.pics.push({url: img})
}) })
}) })
} }
}, },
// 删除图片
quaDeletePic(event) { quaDeletePic(event) {
this[`${event.name}`].splice(event.index, 1) this[`${event.name}`].splice(event.index, 1)
}, },
quaAfterRead(event) { quaAfterRead(event) {
let that = this; let that = this;
if (event.file.length > 0) { if (event.file.length > 0) {
@@ -592,97 +684,97 @@ export default {
}) })
} }
}, },
typeChange(e) {
// 回调参数为包含column indexs、value、values const idx = parseInt(e.detail.value)
confirmType(e) { this.columnsType.map((item, index) => {
this.indexType = e.indexs; if (index === idx) {
this.form.type = e.value[0].id; this.form.typeText = item.name
this.form.typeText = e.value[0].name; this.indexType = index
this.showType = false; this.form.type = item.id
}
})
}, },
cancelType() {
this.showType = false;
},
// 省市区 // 省市区
result(values) { result(values) {
this.address = { this.address = {
province: values.province.name || "", province: values.province.name || '',
city: values.city.name || "", city: values.city.name || '',
district: values.district.name || "", district: values.district.name || '',
provinceId: values.province.id, provinceId: values.province.id,
cityId: values.city.id, cityId: values.city.id,
areaId: values.district.id areaId: values.district.id
}; }
this.form.area = `${this.address.province} ${this.address.city} ${this.address.district}`; this.form.area = `${this.address.province} ${this.address.city} ${this.address.district}`
this.form.provinceId = values.province.id; this.form.provinceId = values.province.id
this.form.cityId = values.city.id; this.form.cityId = values.city.id
this.form.areaId = values.district.id; this.form.areaId = values.district.id
}, },
// 定位 // 定位
chooLocation() { chooLocation() {
let that = this; const _this = this
uni.chooseLocation({ uni.chooseLocation({
success: function (res) { success: function (res) {
that.form.address = res.address; _this.form.address = res.address
that.form.longitude = that.$forceToDecimal(res.longitude, 6); _this.form.longitude = _this.$forceToDecimal(res.longitude, 6)
that.form.latitude = that.$forceToDecimal(res.latitude, 6); _this.form.latitude = _this.$forceToDecimal(res.latitude, 6)
that.form.position = that.$forceToDecimal(res.longitude, 6) + ',' + that.$forceToDecimal(res.latitude, 6); _this.form.position = _this.$forceToDecimal(res.longitude, 6) + ',' + _this.$forceToDecimal(res.latitude, 6)
} }
}); })
}, },
onSubmit() { onSubmit() {
if (this.reviewStatus === 0) return; if (this.reviewStatus === 0) return
if (this.quaPics.length === 0) { if (this.quaPics.length === 0) {
uni.showToast({ uni.showToast({
title: "请上传营业执照", title: '请上传营业执照',
icon: "none" icon: 'none'
}) })
return; return
} }
this.$refs.shopForm.validate().then(res => { this.$refs.shopForm.validate().then(res => {
// 校验通过 // 校验通过
this.show = true; this.show = true
}).catch(errors => { }).catch(errors => {
// 校验失败 // 校验失败
console.log(errors)
}) })
}, },
onRemove() { onRemove() {
removeApply().then(res => { removeApply().then(res => {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: "none", icon: 'none',
duration: 3000, duration: 3000,
success: () => { success: () => {
this.showRemove = false; this.showRemove = false
setTimeout(() => { setTimeout(() => {
uni.navigateBack(); uni.navigateBack()
}, 3000) }, 3000)
} }
}) })
}); })
}, },
changeAgree(event) { changeAgree(event) {
this.isAgree = event.detail.value.length > 0 this.isAgree = event.detail.value.length > 0
}, },
save() { save() {
this.form.pics = ""; this.form.pics = ''
this.pics.map(item => { const picsLength = this.pics.length
this.form.pics += (item.url + ","); if (picsLength > 0) {
}) const tempArr = []
this.form.pics = this.form.pics.substring(0, this.form.pics.length - 1); this.pics.map(item => {
item.url && tempArr.push(item.url)
this.form.qualification = ""; })
this.quaPics.map(item => { this.form.pics = tempArr.join(',')
this.form.qualification += (item.url + ","); }
}) this.form.qualification = ''
this.form.qualification = this.form.qualification.substring(0, this.form.qualification.length - 1); const quaPicsLength = this.quaPics.length
if (quaPicsLength > 0) {
const tempArr = []
this.quaPics.map(item => {
item.url && tempArr.push(item.url)
})
this.form.qualification = tempArr.join(',')
}
const postData = Object.assign({}, this.form) const postData = Object.assign({}, this.form)
if (postData.coverType === 2) { if (postData.coverType === 2) {
postData.cover = postData.coverVideo postData.cover = postData.coverVideo
@@ -690,20 +782,20 @@ export default {
saveShop(postData, this.partnerId).then(res => { saveShop(postData, this.partnerId).then(res => {
if (res.status === 200) { if (res.status === 200) {
uni.showToast({ uni.showToast({
title: "您的入驻申请已提交成功,请耐心等待审核", title: '您的入驻申请已提交成功,请耐心等待审核',
icon: "none", icon: 'none',
success: () => { success: () => {
this.initInfo(); this.initInfo()
this.show = false; this.show = false
} }
}) })
} }
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.msg, title: err.msg,
icon: "none", icon: 'none',
success: () => { success: () => {
this.show = false; this.show = false
} }
}) })
}) })
File diff suppressed because it is too large Load Diff
+218 -130
View File
@@ -1,82 +1,122 @@
<template> <template>
<u--form :model="form" errorType="toast" labelWidth="216rpx" ref="wholesalerForm"> <u--form
<view class="box-state" v-if="stateTitle && isDraft!==1 && applyType === 4"> ref="wholesalerForm"
<u-alert :center="stateType==='primary'" :title="stateTitle" :type="stateType"/> :model="form"
errorType="toast"
labelWidth="216rpx"
>
<view
v-if="stateTitle && isDraft!==1 && applyType === 4"
class="box-state"
>
<u-alert
:center="stateType === 'primary'"
:title="stateTitle"
:type="stateType"
/>
</view> </view>
<u-cell-group
<u-cell-group title="采购批发商基本信息" :border="false" :customStyle="{'fontSize':'40rpx'}"> :border="false"
:customStyle="{'fontSize':'40rpx'}"
title="采购批发商基本信息"
>
<u-form-item prop="name"> <u-form-item prop="name">
<u-cell title="批发商名称" :border="false"> <u-cell title="批发商名称" :border="false">
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
</template> </template>
<template #value> <template #value>
<u-input v-model="form.name" border="none" placeholder="请填写批发商名称"/> <u-input
v-model="form.name"
:disabled="reviewing"
border="none"
placeholder="请填写批发商名称"
/>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="avatar"> <u-form-item prop="avatar">
<u-cell title="头像" :border="false"/> <u-cell title="头像" :border="false"/>
<u-cell :border="false"> <u-cell :border="false">
<template #title> <template #title>
<view class="box-upload" @click="chooseLogoImg('avatar')"> <view class="box-upload" @click="chooseLogoImg('avatar')">
<view class="btn-upload" v-if="form.avatar.length===0">上传图片</view> <view
<image class="img-preview" :src="form.avatar" v-else/> v-if="!form.avatar"
class="btn-upload"
>上传图片</view>
<image
v-else
:src="form.avatar"
class="img-preview"
/>
</view> </view>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="contact"> <u-form-item prop="contact">
<u-cell title="联系人姓名" :border="false"> <u-cell title="联系人姓名" :border="false">
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
</template> </template>
<template #value> <template #value>
<u-input v-model="form.contact" border="none" placeholder="请填写联系人姓名"/> <u-input
v-model="form.contact"
:disabled="reviewing"
border="none"
placeholder="请填写姓名"
/>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="phone"> <u-form-item prop="phone">
<u-cell title="联系方式" :border="false"> <u-cell title="联系方式" :border="false">
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
</template> </template>
<template #value> <template #value>
<u-input v-model="form.phone" border="none" placeholder="请填写联系方式"/> <u-input
v-model="form.phone"
:disabled="reviewing"
type="number"
border="none"
placeholder="请填写联系方式"
/>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="captcha"> <u-form-item prop="captcha">
<u-cell title="验证码" :border="false"> <u-cell title="验证码" :border="false">
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
</template> </template>
<template #value> <template #value>
<u-input v-model="form.captcha" border="none" placeholder="请填写验证码"> <view class="captcha-wrap">
<template slot="suffix"> <view class="captcha-wrap-input">
<u-input
v-model="form.captcha"
:disabled="reviewing"
border="none"
placeholder="请填写验证码"
/>
</view>
<view class="captcha-wrap-ft">
<u-code <u-code
ref="uCode" ref="uCode"
@change="codeChange" seconds="30"
seconds="30" changeText="X秒重新获取"
changeText="X秒重新获取" @change="codeChange"
></u-code> />
<u-button <u-button
@tap="getCode" :text="tips"
:text="tips" type="success"
type="success" size="normal"
size="normal" @tap="getCode"
></u-button> />
</template> </view>
</u-input> </view>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="qualification"> <u-form-item prop="qualification">
<view class="licence-section"> <view class="licence-section">
<u-cell :border="false"> <u-cell :border="false">
@@ -92,14 +132,20 @@
<u-cell :border="false"> <u-cell :border="false">
<template #title> <template #title>
<view class="box-upload" @click="chooseLogoImg('licence')"> <view class="box-upload" @click="chooseLogoImg('licence')">
<view class="btn-upload" v-if="form.qualification.length===0">上传图片</view> <view
<image class="img-preview" :src="form.qualification" v-else/> v-if="!form.qualification"
class="btn-upload"
>上传图片</view>
<image
v-else
:src="form.qualification"
class="img-preview"
/>
</view> </view>
</template> </template>
</u-cell> </u-cell>
</view> </view>
</u-form-item> </u-form-item>
<u-form-item prop="area"> <u-form-item prop="area">
<u-cell title="省市区" :border="false" isLink> <u-cell title="省市区" :border="false" isLink>
<template #icon> <template #icon>
@@ -107,30 +153,54 @@
</template> </template>
<template #value> <template #value>
<view class="u-text__value" :class="{'area-item':form.area.length===0}"> <view class="u-text__value" :class="{'area-item':form.area.length===0}">
<CitySelect ref="cityselect" :defaultValue="form.area" @callback="result" :items="district"/> <CitySelect
ref="cityselect"
:defaultValue="form.area"
:disabled="reviewing"
:items="district"
@callback="result"
/>
</view> </view>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="address"> <u-form-item prop="address">
<u-cell title="详细地址" :border="false"> <u-cell title="详细地址" :border="false">
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
</template> </template>
<template #value> <template #value>
<u-input v-model="form.address" border="none" placeholder="请填写详细地址"/> <u-input
v-model="form.address"
:disabled="reviewing"
border="none"
placeholder="请填写详细地址"
/>
</template> </template>
</u-cell> </u-cell>
</u-form-item> </u-form-item>
</u-cell-group> </u-cell-group>
<view class="btn-submit btn-remove" v-if="reviewStatus===0 && isDraft!==1" @click="changeRemove(true)">撤销申请</view> <view
<view class="btn-submit" @click="onSubmit" v-else>提交申请</view> v-if="reviewStatus === 0 && isDraft !== 1"
class="btn-submit btn-remove"
<u-modal :show="showRemove" content="您确定撤销申请吗?" showCancelButton @cancel="changeRemove(false)" @click="changeRemove(true)"
@confirm="onRemove"></u-modal> >
撤销申请
</view>
<view
v-else
class="btn-submit"
@click="onSubmit"
>
提交申请
</view>
<u-modal
:show="showRemove"
content="您确定撤销申请吗?"
showCancelButton
@cancel="changeRemove(false)"
@confirm="onRemove"
/>
<u-popup :show="show" mode="center" round="10" closeable @close="show=false"> <u-popup :show="show" mode="center" round="10" closeable @close="show=false">
<view class="popup-body"> <view class="popup-body">
<view class="tc bold">入驻申请须知</view> <view class="tc bold">入驻申请须知</view>
@@ -145,35 +215,42 @@
<text>我已仔细阅读并同意</text> <text>我已仔细阅读并同意</text>
</checkbox-group> </checkbox-group>
</view> </view>
<u-button type="error" text="确定" :disabled="!isAgree" @click="save"></u-button> <u-button
type="error"
text="确定"
:disabled="!isAgree"
@click="save"
/>
</view> </view>
</u-popup> </u-popup>
</u--form> </u--form>
</template> </template>
<script> <script>
import CitySelect from "@/components/CitySelect"; import CitySelect from '@/components/CitySelect'
import {getShopData, getWholesaler, removeApply, saveWholesaler} from "@/api/join"; import {getShopData, getWholesaler, removeApply, saveWholesaler} from '@/api/join'
import {getCity, registerVerify} from "@/api/user"; import {getCity, registerVerify} from '@/api/user'
import {chooseImage} from "@/utils"; import {chooseImage} from '@/utils'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "pkgJoinWholesaler", name: 'pkgJoinWholesaler',
components: { components: {
CitySelect CitySelect
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
tips: "", tips: '获取验证码',
form: { form: {
name: "", name: '',
avatar: "", avatar: '',
contact: "", contact: '',
phone: "", phone: '',
captcha: "", captcha: '',
qualification: "", qualification: '',
area: "", area: '',
address: "" address: ''
}, },
rules: { rules: {
'name': { 'name': {
@@ -219,174 +296,178 @@ export default {
trigger: ['blur', 'change'] trigger: ['blur', 'change']
} }
}, },
district: [], district: [],
address: {}, address: {},
isAgree: false, isAgree: false,
show: false, show: false,
notice: "", notice: '',
showRemove: false, showRemove: false,
applyType: null, applyType: null,
isDraft: null, isDraft: null,
reviewStatus: null, reviewStatus: null,
stateTitle: "", stateTitle: '',
stateType: "primary", stateType: 'primary',
isPass: false // 是否为审核中
reviewing: false,
pageKeyId: Object.freeze('merchantApplyWholesaler')
} }
}, },
onLoad(options) { onLoad(options) {
this.init(); this.init()
}, },
onReady() { onReady() {
this.$refs.wholesalerForm.setRules(this.rules); this.$refs.wholesalerForm.setRules(this.rules)
}, },
methods: { methods: {
changeRemove(state){ changeRemove(state){
this.showRemove=state this.showRemove = state
}, },
codeChange(text) { codeChange(text) {
this.tips = text; this.tips = text
}, },
getCode() { getCode() {
if (this.form.phone.length === 0) return; if (this.reviewing) return
if (this.form.phone.length === 0) {
uni.$u.toast('请输入位手机号')
return
}
if (this.form.phone.length !== 11) {
uni.$u.toast('请输入11位手机号')
return
}
if (this.$refs.uCode.canGetCode) { if (this.$refs.uCode.canGetCode) {
uni.showLoading({ uni.showLoading({
title: '正在获取验证码' title: '正在获取验证码'
}) })
registerVerify({phone: this.form.phone, type: "merchantApply"}).then(() => { registerVerify({
uni.hideLoading(); phone: this.form.phone,
type: 'merchantApply'
}).then(() => {
uni.hideLoading()
// 这里此提示会被this.start()方法中的提示覆盖 // 这里此提示会被this.start()方法中的提示覆盖
uni.$u.toast('验证码已发送'); uni.$u.toast('验证码已发送')
// 通知验证码组件内部开始倒计时 // 通知验证码组件内部开始倒计时
this.$refs.uCode.start(); this.$refs.uCode.start()
}).catch(err => { }).catch(err => {
uni.hideLoading(); uni.hideLoading()
uni.$u.toast(err.msg); uni.$u.toast(err.msg)
}) })
} else { } else {
uni.$u.toast('倒计时结束后再发送'); uni.$u.toast('倒计时结束后再发送')
} }
}, },
init() { init() {
getCity().then(({data}) => { getCity().then(({data}) => {
this.district = data; this.district = data
}); })
getShopData().then(({data}) => { getShopData().then(({data}) => {
this.notice = data.merchantApplyNotice; this.notice = data.merchantApplyNotice
this.initInfo(); this.initInfo()
}); })
}, },
initInfo() { initInfo() {
getWholesaler().then(({data}) => { getWholesaler().then(({data}) => {
this.applyType = data.applyType; this.applyType = data.applyType
if (data.applyType === 4) { if (data.applyType === 4) {
this.isDraft = data.isDraft; this.isDraft = data.isDraft
this.reviewStatus = data.reviewStatus; this.reviewStatus = data.reviewStatus
} }
switch (data.reviewStatus) { switch (data.reviewStatus) {
case 0: case 0:
this.stateTitle = "审核中"; this.stateTitle = '审核中'
this.stateType = "primary"; this.stateType = 'primary'
this.reviewing = true
break; break;
case 1: case 1:
this.isPass = true; this.reviewing = false
break; break;
case 2: case 2:
this.stateTitle = "审核驳回:" + data.reviewMsg; this.stateTitle = '审核驳回:' + data.reviewMsg
this.stateType = "error"; this.stateType = 'error'
this.reviewing = false
break; break;
} }
if (data.wholesalerInfo) { if (data.wholesalerInfo) {
this.form = data.wholesalerInfo; this.form = data.wholesalerInfo
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6); this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6)
this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`; this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`
} }
}); })
}, },
chooseLogoImg(target) { chooseLogoImg(target) {
if (this.reviewing) return
chooseImage(img => { chooseImage(img => {
switch (target) { switch (target) {
case "avatar": case 'avatar':
this.form.avatar = img; this.form.avatar = img
break; break
case "licence": case 'licence':
this.form.qualification = img; this.form.qualification = img
break; break
} }
}); })
}, },
// 省市区 // 省市区
result(values) { result(values) {
this.address = { this.address = {
province: values.province.name || "", province: values.province.name || '',
city: values.city.name || "", city: values.city.name || '',
district: values.district.name || "", district: values.district.name || '',
provinceId: values.province.id, provinceId: values.province.id,
cityId: values.city.id, cityId: values.city.id,
areaId: values.district.id areaId: values.district.id
}; }
this.form.area = `${this.address.province} ${this.address.city} ${this.address.district}`; this.form.area = `${this.address.province} ${this.address.city} ${this.address.district}`
this.form.provinceId = values.province.id; this.form.provinceId = values.province.id
this.form.cityId = values.city.id; this.form.cityId = values.city.id
this.form.areaId = values.district.id; this.form.areaId = values.district.id
}, },
onSubmit() { onSubmit() {
this.$refs.wholesalerForm.validate().then(res => { this.$refs.wholesalerForm.validate().then(res => {
// 校验通过 // 校验通过
this.show = true; this.show = true
}).catch(errors => { }).catch(errors => {
// 校验失败 // 校验失败
console.log(errors)
}) })
}, },
onRemove() { onRemove() {
removeApply().then(res => { removeApply().then(res => {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: "none", icon: 'none',
duration: 3000, duration: 3000,
success: () => { success: () => {
this.showRemove = false; this.showRemove = false
setTimeout(() => { setTimeout(() => {
uni.navigateBack(); uni.navigateBack()
}, 3000) }, 3000)
} }
}) })
}); })
}, },
changeAgree(event) { changeAgree(event) {
this.isAgree = event.detail.value.length > 0 this.isAgree = event.detail.value.length > 0
}, },
save() { save() {
saveWholesaler(this.form).then(res => { saveWholesaler(this.form).then(res => {
if (res.status === 200) { if (res.status === 200) {
uni.showToast({ uni.showToast({
title: "您的入驻申请已提交成功,请耐心等待审核", title: '您的入驻申请已提交成功,请耐心等待审核',
icon: "none", icon: 'none',
success: () => { success: () => {
this.initInfo(); this.initInfo()
this.show = false; this.show = false
} }
}) })
} }
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.msg, title: err.msg,
icon: "none", icon: 'none',
success: () => { success: () => {
this.show = false; this.show = false
} }
}) })
}) })
@@ -418,4 +499,11 @@ export default {
.font-color-red{ .font-color-red{
font-size: 24rpx; font-size: 24rpx;
} }
.captcha-wrap {
display: flex;
align-items: center;
.captcha-wrap-input {
flex: 1;
}
}
</style> </style>
+8 -2
View File
@@ -3,7 +3,7 @@
<u--form :model="form" errorType="toast" ref="refundForm"> <u--form :model="form" errorType="toast" ref="refundForm">
<view class="upload-section"> <view class="upload-section">
<u-form-item prop="refundReasonWapImg"> <u-form-item prop="refundReasonWapImg">
<view class="title">上传图片</view> <view class="title"><text class="require-txt">*</text>上传图片</view>
<view class="upload-box"> <view class="upload-box">
<u-upload <u-upload
:fileList="pics" :fileList="pics"
@@ -31,7 +31,7 @@
<view class="cause-section"> <view class="cause-section">
<u-form-item prop="refundReasonWapExplain"> <u-form-item prop="refundReasonWapExplain">
<view class="title">退款理由</view> <view class="title"><text class="require-txt">*</text>退款理由</view>
<view class="input-box row"> <view class="input-box row">
<u--textarea v-model="form.refundReasonWapExplain" placeholder="请输入退款理由..." <u--textarea v-model="form.refundReasonWapExplain" placeholder="请输入退款理由..."
border="none"></u--textarea> border="none"></u--textarea>
@@ -232,6 +232,9 @@ export default {
.title { .title {
margin-bottom: 0; margin-bottom: 0;
text {
color: #FF564A;
}
} }
.option { .option {
@@ -261,4 +264,7 @@ export default {
color: #fff; color: #fff;
font-size: 36rpx; font-size: 36rpx;
} }
.require-txt {
color: #FF564A;
}
</style> </style>
+25 -10
View File
@@ -7,7 +7,7 @@
<view class="story-box flex flex-col ai-center"> <view class="story-box flex flex-col ai-center">
<image class="story-title" :src="webUrl+'/20230313105024432472.png'" mode="scaleToFill"/> <image class="story-title" :src="webUrl+'/20230313105024432472.png'" mode="scaleToFill"/>
<view class="story-content"> <view class="story-content">
<view v-html="story.content"></view> <view v-html="story.content" />
</view> </view>
</view> </view>
</view> </view>
@@ -16,7 +16,7 @@
<image class="title" :src="webUrl+'/20230220023931078168.png'" mode="scaleToFill"/> <image class="title" :src="webUrl+'/20230220023931078168.png'" mode="scaleToFill"/>
<view class="item flex" :style="{'backgroundImage':`url(${webUrl}/20230224102624521679.png)`}" <view class="item flex" :style="{'backgroundImage':`url(${webUrl}/20230224102624521679.png)`}"
v-for="(item,index) in products" :key="index" @click="$global.navToGoods(item.id)"> v-for="(item,index) in products" :key="index" @click="goGoods(item.id)">
<image class="cover flex-0" style="margin-right: 20rpx" :src="item.image" <image class="cover flex-0" style="margin-right: 20rpx" :src="item.image"
mode="scaleToFill" v-if="index%2===0"/> mode="scaleToFill" v-if="index%2===0"/>
@@ -25,7 +25,11 @@
<view class="name more-t">{{ item.storeName }}</view> <view class="name more-t">{{ item.storeName }}</view>
<!-- <view class="unit">100g/</view>--> <!-- <view class="unit">100g/</view>-->
<view class="flex ai-center" style="margin-top: 12rpx" v-if="item.tags.length"> <view class="flex ai-center" style="margin-top: 12rpx" v-if="item.tags.length">
<view class="label flex jc-center ai-center" v-for="tag in item.tags">{{ tag }}</view> <view
v-for="(tag, tagIndex) in item.tags"
:key="tagIndex"
class="label flex jc-center ai-center"
>{{ tag }}</view>
</view> </view>
</view> </view>
<view class="flex jc-between ai-center"> <view class="flex jc-between ai-center">
@@ -42,24 +46,35 @@
</template> </template>
<script> <script>
import {getStoryDetail} from "@/api/product"; import {getStoryDetail} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "famousHot", name: 'FamousHot',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
products: [], products: [],
id: null, id: null,
story: null story: null,
pageKeyId: ''
} }
}, },
onLoad(option) { onLoad(option) {
this.id = option.id; const id = option.id
this.id = option.id
this.pageKeyId = `countyFamousContent_id_${id}`
getStoryDetail(this.id).then(({data}) => { getStoryDetail(this.id).then(({data}) => {
this.story = data; this.story = data
this.products = data.products; this.products = data.products
}) })
},
methods: {
goGoods(id) {
uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${id}&from=famous`
})
}
} }
} }
</script> </script>
+17 -14
View File
@@ -39,29 +39,32 @@
</template> </template>
<script> <script>
import {countyFamous} from "@/api/product"; import {countyFamous} from '@/api/product'
import {getProducts} from "@/api/store"; import {getProducts} from '@/api/store'
import {famousShareImage} from "@/api/share"; import {famousShareImage} from '@/api/share'
import {mapGetters} from "vuex"; import {mapGetters} from 'vuex'
import cookie from "@/utils/store/cookie"; import cookie from '@/utils/store/cookie'
import {userBindParent} from "@/api/user"; import {userBindParent} from '@/api/user'
import {getUrlParam} from "@/utils/common.js"; import {getUrlParam} from '@/utils/common.js'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "famousList", name: 'FamousList',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
keyword: "", keyword: '',
page: 1, page: 1,
bannerList: [], bannerList: [],
dataList: [], dataList: [],
navList: [], navList: [],
navIndex: 0, navIndex: 0,
partnerId: null partnerId: null,
pageKeyId: Object.freeze('countyFamousIndex')
} }
}, },
computed: mapGetters(["userInfo", "isLogin"]), computed: mapGetters(['userInfo', 'isLogin']),
onShareAppMessage() { onShareAppMessage() {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
const {status, data} = await famousShareImage(); const {status, data} = await famousShareImage();
@@ -81,11 +84,11 @@ export default {
let obj = uni.getEnterOptionsSync(); let obj = uni.getEnterOptionsSync();
if (options.scene != null || obj.query.scene != null) { if (options.scene != null || obj.query.scene != null) {
let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene); let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene);
this.partnerId = getUrlParam(query, "partnerId") || null; this.partnerId = getUrlParam(query, 'partnerId') || null;
} }
} }
if (this.partnerId) { if (this.partnerId) {
cookie.set("spread", this.partnerId); cookie.set('spread', this.partnerId);
userBindParent({spread: parseInt(this.partnerId)}); userBindParent({spread: parseInt(this.partnerId)});
} }
@@ -132,7 +135,7 @@ export default {
}, },
goStory() { goStory() {
uni.navigateTo({ uni.navigateTo({
url: "/pkg_product/views/famousStory" url: '/pkg_product/views/famousStory'
}) })
} }
} }
+20 -10
View File
@@ -1,44 +1,54 @@
<template> <template>
<view class="famous-story"> <view class="famous-story">
<image class="img" :src="item.image" mode="scaleToFill" v-for="item in list" @click="goHot(item)"/> <image
v-for="(item, index) in list"
:key="index"
:src="item.image"
class="img"
mode="scaleToFill"
@click="goHot(item)"
/>
</view> </view>
</template> </template>
<script> <script>
import {getStoryList} from "@/api/product"; import {getStoryList} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "famousStory", name: 'FamousStory',
mixins: [pageListenMixins],
data() { data() {
return { return {
page: 1, // 当前页 page: 1, // 当前页
pages: 1, // 总页数 pages: 1, // 总页数
list: [] list: [],
pageKeyId: Object.freeze('countyFamousContentList')
} }
}, },
onLoad() { onLoad() {
this.fetchData(); this.fetchData()
}, },
onReachBottom() { onReachBottom() {
if (this.page < this.pages) { if (this.page < this.pages) {
this.page++; this.page++
this.fetchData(); this.fetchData()
} }
}, },
methods: { methods: {
fetchData() { fetchData() {
getStoryList(this.page).then(({data}) => { getStoryList(this.page).then(({data}) => {
this.pages = data.pages; this.pages = data.pages
if (data.records.length > 0) { if (data.records.length > 0) {
for (let i = 0; i < data.records.length; i++) { for (let i = 0; i < data.records.length; i++) {
this.list.push(data.records[i]); this.list.push(data.records[i])
} }
} }
}) })
}, },
goHot(item) { goHot(item) {
uni.navigateTo({ uni.navigateTo({
url: "/pkg_product/views/famousHot?id=" + item.id url: '/pkg_product/views/famousHot?id=' + item.id
}) })
} }
} }
+13 -3
View File
@@ -35,7 +35,7 @@
:class="cIndex === 0 ? 'span12' : 'span8'" :class="cIndex === 0 ? 'span12' : 'span8'"
:src="item.image" :src="item.image"
mode="scaleToFill" mode="scaleToFill"
@click="$global.navToGoods(item.id)" @click="goGoods(item.id)"
/> />
</view> </view>
</view> </view>
@@ -46,13 +46,16 @@
<script> <script>
// 节日专题 // 节日专题
import { getFestival } from '@/api/product' import { getFestival } from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'Festival', name: 'FestivalPage',
mixins: [pageListenMixins],
data() { data() {
return { return {
isLoad: false, isLoad: false,
topImage: '', topImage: '',
contents: [] contents: [],
pageKeyId: Object.freeze('appContentFestival')
} }
}, },
onLoad() { onLoad() {
@@ -61,6 +64,13 @@ export default {
this.topImage = data.topImage this.topImage = data.topImage
this.contents = data.contents this.contents = data.contents
}) })
},
methods: {
goGoods(id) {
uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${id}&from=festival`
})
}
} }
} }
</script> </script>
+7 -2
View File
@@ -43,8 +43,10 @@
import { import {
customizedGiftContent customizedGiftContent
} from '@/api/product' } from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'GiftContent', name: 'GiftContent',
mixins: [pageListenMixins],
data() { data() {
return { return {
data: { data: {
@@ -55,6 +57,7 @@ export default {
mainImage: '', mainImage: '',
productList1: [], productList1: [],
productList2: [], productList2: [],
pageKeyId: ''
} }
} }
}, },
@@ -62,7 +65,9 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: options.name + '-' + '特色礼品' title: options.name + '-' + '特色礼品'
}) })
this.getPageDataReq(options.id) const id = options.id
this.pageKeyId = `customizedGiftContent_id_${id}`
this.getPageDataReq(id)
}, },
methods: { methods: {
getPageDataReq(id) { getPageDataReq(id) {
@@ -90,7 +95,7 @@ export default {
return return
} }
uni.navigateTo({ uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${productId}` url: `/pages/shop/GoodsCon/index?id=${productId}&from=gift`
}) })
} }
} }
+5 -2
View File
@@ -90,14 +90,17 @@
import { import {
customizedGift customizedGift
} from '@/api/product' } from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'GiftList', name: 'GiftList',
mixins: [pageListenMixins],
data() { data() {
return { return {
provinceList: [], provinceList: [],
topBannerHtml: '', topBannerHtml: '',
topBannerUrl: '', topBannerUrl: '',
toggleStatus: false toggleStatus: false,
pageKeyId: Object.freeze('customizedGiftIndex')
} }
}, },
onLoad() { onLoad() {
@@ -148,7 +151,7 @@ export default {
return return
} }
uni.navigateTo({ uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${productId}` url: `/pages/shop/GoodsCon/index?id=${productId}&from=gift`
}) })
}, },
toggleHandle(value) { toggleHandle(value) {
+158 -76
View File
@@ -2,63 +2,143 @@
<view class="pkg-product-list"> <view class="pkg-product-list">
<view class="first-half"> <view class="first-half">
<view class="search-box flex jc-between ai-center"> <view class="search-box flex jc-between ai-center">
<input type="text" v-model="keyword" placeholder="搜索内容" placeholder-style="color:#949494" @confirm="search"> <input
<image class="icon" :src="webUrl+'/20220903142935869059.png'" mode="scaleToFill" @click="search"></image> v-model="keyword"
type="text"
placeholder="搜索内容"
placeholder-style="color:#949494"
@confirm="search"
>
<image
:src="webUrl+'/20220903142935869059.png'"
class="icon"
mode="scaleToFill"
@click="search"
/>
</view> </view>
<swiper
<swiper class="swiper-box" indicator-dots indicator-color="rgba(255,255,255,.3)" indicator-active-color="#fff" v-if="bannerList.length > 0"
autoplay circular v-if="bannerList.length>0"> indicator-dots
<swiper-item v-for="(item,index) in bannerList" :key="index"> indicator-color="rgba(255,255,255,.3)"
<image :src="item.pic" mode="scaleToFill" @click="$global.commonJump(item.uniappUrl)"/> indicator-active-color="#fff"
autoplay
circular
class="swiper-box"
>
<swiper-item
v-for="(item, index) in bannerList"
:key="index"
>
<image
:src="item.pic"
mode="scaleToFill"
@click="$global.commonJump(item.uniappUrl)"
/>
</swiper-item> </swiper-item>
</swiper> </swiper>
<view
<view class="tab-box flex jc-center ai-center" v-show="tabIndex===0"> v-show="tabIndex === 0"
<image class="active" src="/static/images/v6/btn_active_left.png" @click="changeTab(0)"/> class="tab-box flex jc-center ai-center"
<image class="inactive" src="/static/images/v6/btn_right.png" @click="changeTab(1)"/> >
<image
src="/static/images/v6/btn_active_left.png"
class="active"
@click="changeTab(0)"
/>
<image
src="/static/images/v6/btn_right.png"
class="inactive"
@click="changeTab(1)"
/>
</view> </view>
<view class="tab-box flex jc-center ai-center" v-show="tabIndex===1"> <view
<image class="inactive" src="/static/images/v6/btn_left.png" @click="changeTab(0)"/> v-show="tabIndex === 1"
<image class="active" src="/static/images/v6/btn_active_right.png" @click="changeTab(1)"/> class="tab-box flex jc-center ai-center"
>
<image
src="/static/images/v6/btn_left.png"
class="inactive"
@click="changeTab(0)"
/>
<image
src="/static/images/v6/btn_active_right.png"
class="active"
@click="changeTab(1)"
/>
</view> </view>
</view> </view>
<view class="body-box"> <view class="body-box">
<view class="aside-box flex-0"> <view class="aside-box flex-0">
<view class="item flex jc-center ai-center" :class="index === asideIndex ? 'active' : ''" <view
v-for="(item, index) in asideList" :key="index" @click="asideTap(index)"> v-for="(item, index) in asideList"
:key="index"
:class="index === asideIndex ? 'active' : ''"
class="item flex jc-center ai-center"
@click="asideTap(index)"
>
<text class="one-t">{{ item.label }}</text> <text class="one-t">{{ item.label }}</text>
</view> </view>
</view> </view>
<view class="article-box"> <view class="article-box">
<scroll-view class="list flex flex-wrap" :style="{'height':listHeight}" :enable-flex="true" <scroll-view
:scroll-anchoring="true" v-if="dataList.length > 0"
:scroll-y="true" :style="{'height':listHeight}"
:scroll-with-animation="true" :enable-back-to-top="true" @scrolltolower="onLower" :enable-flex="true"
v-if="dataList.length>0"> :scroll-anchoring="true"
<view v-for="(item, index) in dataList" :key="index"> :scroll-y="true"
<view class="item item-store" @click="goStore(item.id)" v-if="tabIndex===0"> :scroll-with-animation="true"
<image class="cover" :src="item.cover" mode="scaleToFill"/> :enable-back-to-top="true"
class="list flex flex-wrap"
@scrolltolower="onLower"
>
<view
v-for="(item, index) in dataList"
:key="index"
>
<view
v-if="tabIndex === 0"
class="item item-store"
@click="goStore(item.id)"
>
<image
:src="item.cover"
class="cover"
mode="scaleToFill"
/>
<view class="name one-t">{{ item.content }}</view> <view class="name one-t">{{ item.content }}</view>
<view class="price store flex ai-center" style="width: 100%;"> <view class="price store flex ai-center" style="width: 100%;">
<image class="flex-0" :src="item.logo" mode="scaleToFill"/> <image
:src="item.logo"
class="flex-0"
mode="scaleToFill"
/>
<view class="one-t">{{ item.name }}</view> <view class="one-t">{{ item.name }}</view>
</view> </view>
</view> </view>
<view class="item" @click="goGoods(item.id)" v-else> <view class="item" @click="goGoods(item.id)" v-else>
<image class="cover" :src="item.image" mode="scaleToFill"/> <image
:src="item.image"
class="cover"
mode="scaleToFill"
/>
<view class="name more-t">{{ item.storeName }}</view> <view class="name more-t">{{ item.storeName }}</view>
<view class="price">{{ item.price }}</view> <view class="price">{{ item.price }}</view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="tc" v-else> <view class="tc" v-else>
<image class="img-nodata" :src="webUrl+'/20240106205121705480.png'" mode="scaleToFill" <image
v-if="tabIndex===0"/> v-if="tabIndex === 0"
<image class="img-nodata" :src="webUrl+'/20240219170514226953.png'" mode="scaleToFill" v-else/> :src="webUrl+'/20240106205121705480.png'"
class="img-nodata"
mode="scaleToFill"
/>
<image
v-else
:src="webUrl+'/20240219170514226953.png'"
class="img-nodata"
mode="scaleToFill"
/>
</view> </view>
</view> </view>
</view> </view>
@@ -66,103 +146,105 @@
</template> </template>
<script> <script>
import {fetchCity} from "@/api/wenwan"; // 康养食材
import {wellnessFood, wellnessPlaceList} from "@/api/product"; import { fetchCity } from '@/api/wenwan'
import {getProducts} from "@/api/store"; import { wellnessFood, wellnessPlaceList } from '@/api/product'
import { getProducts } from '@/api/store'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "healthList", name: 'HealthList',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
tabIndex: 0, tabIndex: 0,
keyword: "", keyword: '',
page: 1, page: 1,
listHeight: "auto", listHeight: 'auto',
bannerList: [], bannerList: [],
asideList: [], asideList: [],
asideIndex: 0, asideIndex: 0,
dataList: [], // 列表数据 dataList: [],
pageKeyId: Object.freeze('wellnessFoodIndex')
} }
}, },
onLoad() { onLoad() {
this.init(); this.init()
}, },
methods: { methods: {
init() { init() {
wellnessFood().then(({data}) => { wellnessFood().then(({data}) => {
this.bannerList = data.banner this.bannerList = data.banner
}); })
fetchCity(4).then(({data}) => { fetchCity(4).then(({data}) => {
this.asideList = data.group; this.asideList = data.group
this.search(); this.search()
}); })
}, },
changeTab(index) { changeTab(index) {
if (this.asideList.length === 0) return; if (this.asideList.length === 0) return
if (index === this.tabIndex) return; if (index === this.tabIndex) return
this.page = 1; this.page = 1
this.dataList = []; this.dataList = []
this.tabIndex = index; this.tabIndex = index
this.search(); this.search()
}, },
onLower() { onLower() {
this.page++; this.page++
this.search(); this.search()
}, },
search() { search() {
let param = { let param = {
page: this.page, page: this.page,
limit: 10, limit: 10,
keyword: this.keyword, keyword: this.keyword,
provinceId: this.asideList.length > 0 ? this.asideList[this.asideIndex].provinceId : "" provinceId: this.asideList.length > 0 ? this.asideList[this.asideIndex].provinceId : ''
} }
if (this.tabIndex === 0) { if (this.tabIndex === 0) {
wellnessPlaceList(param).then(({data}) => { wellnessPlaceList(param).then(({data}) => {
this.handleData(data); this.handleData(data)
}); })
} else { } else {
param.isWellnessFood = 1; param.isWellnessFood = 1
getProducts(param).then(({data}) => { getProducts(param).then(({data}) => {
this.handleData(data); this.handleData(data)
}); })
} }
}, },
handleData(data) { handleData(data) {
let that = this; const that = this
if (this.page === 1) { if (this.page === 1) {
this.dataList = []; this.dataList = []
} }
this.dataList = this.dataList.concat(data); this.dataList = this.dataList.concat(data)
uni.getSystemInfo({ uni.getSystemInfo({
success: function (res) { success: function (res) {
let len = that.dataList.length; const len = that.dataList.length
let {windowHeight} = res; const {windowHeight} = res
that.listHeight = "auto"; that.listHeight = 'auto'
if (windowHeight > 600 && len > 4) { if (windowHeight > 600 && len > 4) {
that.listHeight = "100%"; that.listHeight = '100%'
} }
if (windowHeight <= 600 && len > 2) { if (windowHeight <= 600 && len > 2) {
that.listHeight = "100%"; that.listHeight = '100%'
} }
} }
}); })
}, },
asideTap(index) { asideTap(index) {
this.asideIndex = index; this.asideIndex = index
this.page = 1; this.page = 1
this.dataList = []; this.dataList = []
this.search(); this.search()
}, },
goStore(id) { goStore(id) {
uni.navigateTo({ uni.navigateTo({
url: "/pagesInn/inn/innHome?id=" + id url: '/pagesInn/inn/innHome?id=' + id + '&from=wellness'
}) })
}, },
goGoods(id) { goGoods(id) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/shop/GoodsCon/index?id=" + id url: '/pages/shop/GoodsCon/index?id=' + id + '&from=wellness'
}) })
} }
} }
+16 -13
View File
@@ -1,23 +1,26 @@
<script> <script>
import {getICH} from "@/api/product"; import {getICH} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "heritage", name: 'HeritagePage',
mixins: [pageListenMixins],
data() { data() {
return { return {
contents: [], contents: [],
topImage: '', topImage: '',
backgroundImage: '', backgroundImage: '',
bgImgWidth: 0, bgImgWidth: 0,
pageKeyId: Object.freeze('ichIndex')
} }
}, },
computed: { computed: {
scale() { scale() {
return 750 / this.bgImgWidth; return 750 / this.bgImgWidth
} }
}, },
onLoad() { onLoad() {
this.init(); this.init()
}, },
methods: { methods: {
init() { init() {
@@ -29,25 +32,28 @@ export default {
this.calcPosition(); this.calcPosition();
}) })
}, },
// 计算位置 // 计算位置
calcPosition() { calcPosition() {
this.contents?.forEach(item => { this.contents?.forEach(item => {
item.gx = item.x * this.scale; item.gx = item.x * this.scale
item.gy = item.y * this.scale; item.gy = item.y * this.scale
}) })
}, },
goDetails(item) { goDetails(item) {
if (!item.isLink) return; if (!item.isLink) return
// 1-视频,2-图文(可配置商品),3-商品+视频
if (item.type === 1) { if (item.type === 1) {
uni.navigateTo({ uni.navigateTo({
url: '/pkg_product/views/heritageVideo?id=' + item.id url: '/pkg_product/views/heritageVideo?id=' + item.id
}) })
} else { } else if (item.type === 2) {
uni.navigateTo({ uni.navigateTo({
url: '/pkg_product/views/heritageGoods?id=' + item.id url: '/pkg_product/views/heritageGoods?id=' + item.id
}) })
} else if (item.type === 3) {
uni.navigateTo({
url: '/pkg_product/views/heritageGoodAndVideo?id=' + item.id
})
} }
} }
} }
@@ -57,16 +63,13 @@ export default {
<template> <template>
<view class="pkg-product-heritage"> <view class="pkg-product-heritage">
<image style="width: 100%" :src="topImage" mode="widthFix"/> <image style="width: 100%" :src="topImage" mode="widthFix"/>
<view class="main-box"> <view class="main-box">
<image style="width: 100%" :src="backgroundImage" mode="widthFix"/> <image style="width: 100%" :src="backgroundImage" mode="widthFix"/>
<view class="item" :style="{'left':item.gx+'rpx','top':item.gy+'rpx'}" v-for="(item,index) in contents" <view class="item" :style="{'left':item.gx+'rpx','top':item.gy+'rpx'}" v-for="(item,index) in contents"
:key="index" @click="goDetails(item)"> :key="index" @click="goDetails(item)">
<image class="img-item" :src="item.image"/> <image class="img-item" :src="item.image"/>
<view class="title flex jc-center">{{ item.title }}</view> <view class="title flex jc-center">{{ item.title }}</view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
+103
View File
@@ -0,0 +1,103 @@
<script>
import {getICHDetails} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default {
name: 'HeritageGoodAndVideo',
mixins: [pageListenMixins],
data() {
return {
id: null,
info: null,
pageKeyId: ''
}
},
onLoad(options) {
const id = options.id
this.id = id
this.pageKeyId = `ichContent_id_${id}`
this.getDetails()
},
methods: {
getDetails() {
getICHDetails(this.id).then(({data}) => this.info = data)
},
goGoods(id) {
uni.navigateTo({
url: '/pages/shop/GoodsCon/index?id=' + id + '&from=ich'
})
}
}
}
</script>
<template>
<view class="heritage-video" v-if="info">
<image
:src="info.backgroundImage"
class="page-bg"
mode="widthFix"
/>
<video :src="info.video" autoplay show-center-play-btn />
<view class="list-box flex flex-wrap">
<view
v-for="(item,index) in info.products"
:key="index"
class="item flex flex-col jc-between"
@click="goGoods(item.productId)"
>
<view class="flex flex-col ai-center">
<image :src="item.productImage" mode="scaleToFill" />
</view>
</view>
</view>
</view>
</template>
<style scoped lang="less">
.heritage-video {
position: relative;
min-height: 100vh;
.page-bg {
width: 100vw;
height: auto;
vertical-align: middle;
}
video {
position: absolute;
left: 33rpx;
top: 880rpx;
width: 684rpx;
height: 424rpx;
}
}
.list-box {
position: absolute;
top: 10986rpx;
left: 0;
width: 100vw;
box-sizing: border-box;
padding: 0 32rpx;
.item {
width: 332rpx;
height: 332rpx;
margin-right: 22rpx;
margin-bottom: 22rpx;
background: #FFFEF3;
image {
width: 332rpx;
height: 332rpx;
border-radius: 8rpx;
vertical-align: middle;
}
}
.item:nth-child(2n) {
margin-right: 0;
}
}
</style>
+20 -12
View File
@@ -1,39 +1,47 @@
<script> <script>
import {getICHDetails} from "@/api/product"; import {getICHDetails} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "heritageGoods", name: 'HeritageGoods',
mixins: [pageListenMixins],
data() { data() {
return { return {
id: null, id: null,
type: 2,
info: null, info: null,
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.id = options.id; const id = options.id
this.getDetails(); this.id = id
this.pageKeyId = `ichContent_id_${id}`
this.getDetails()
}, },
methods: { methods: {
getDetails() { getDetails() {
getICHDetails(this.id).then(({data}) => this.info = data); getICHDetails(this.id).then(({data}) => this.info = data)
}, },
goGoods(id) { goGoods(id) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/shop/GoodsCon/index?id=" + id url: '/pages/shop/GoodsCon/index?id=' + id + '&from=ich'
}) })
}, }
} }
} }
</script> </script>
<template> <template>
<view class="heritage-goods" v-if="info"> <view class="heritage-goods" v-if="info">
<image class="page-bg" :src="info.backgroundImage" mode="widthFix"/> <image class="page-bg" :src="info.backgroundImage" mode="widthFix" />
<view class="list-box flex flex-wrap"> <view class="list-box flex flex-wrap">
<view class="item flex flex-col jc-between" v-for="(item,index) in info.products" :key="index" <view
@click="goGoods(item.productId)"> v-for="(item,index) in info.products"
:key="index"
class="item flex flex-col jc-between"
@click="goGoods(item.productId)"
>
<view class="flex flex-col ai-center"> <view class="flex flex-col ai-center">
<image :src="item.image" mode="scaleToFill"/> <image :src="item.image" mode="scaleToFill"/>
<view class="more-t">{{ item.storeName }}</view> <view class="more-t">{{ item.storeName }}</view>
+10 -9
View File
@@ -1,21 +1,25 @@
<script> <script>
import {getICHDetails} from "@/api/product"; import {getICHDetails} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "heritageVideo", name: 'HeritageVideo',
mixins: [pageListenMixins],
data() { data() {
return { return {
id: null, id: null,
info: null, info: null,
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.id = options.id; const id = options.id
this.getDetails(); this.id = id
this.pageKeyId = `ichContent_id_${id}`
this.getDetails()
}, },
methods: { methods: {
getDetails() { getDetails() {
getICHDetails(this.id).then(({data}) => this.info = data); getICHDetails(this.id).then(({data}) => this.info = data)
} }
} }
} }
@@ -25,9 +29,6 @@ export default {
<view class="heritage-video" v-if="info"> <view class="heritage-video" v-if="info">
<image class="page-bg" :src="info.backgroundImage" mode="widthFix"/> <image class="page-bg" :src="info.backgroundImage" mode="widthFix"/>
<video :src="info.video" autoplay show-center-play-btn/> <video :src="info.video" autoplay show-center-play-btn/>
<!-- <video id="myVideo" src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4"-->
<!-- autoplay controls></video>-->
</view> </view>
</template> </template>
+14 -10
View File
@@ -1,30 +1,34 @@
<script> <script>
import {getHomestay} from "@/api/product"; // 民宿专题
import {getHomestay} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "homestay", // 民宿专题 name: 'HomestayPage',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
topImage: '', topImage: '',
contents: [], contents: [],
id: null id: null,
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.id = options.id; const id = options.id
this.id = id
this.pageKeyId = `appContentHomestay_id_${id}`
getHomestay(this.id).then(({data}) => { getHomestay(this.id).then(({data}) => {
this.topImage = data.topImage; this.topImage = data.topImage
this.contents = data.contents; this.contents = data.contents
}) })
}, },
methods: { methods: {
goInnDetail(item) { goInnDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pagesInn/inn/innHome?id=${item.id}` url: `/pagesInn/inn/innHome?id=${item.id}&from=homestay`
}) })
}, }
} }
} }
</script> </script>
+116 -93
View File
@@ -2,143 +2,153 @@
<view class="pkg-product-list"> <view class="pkg-product-list">
<view class="top-box"> <view class="top-box">
<view class="search-box flex jc-between ai-center"> <view class="search-box flex jc-between ai-center">
<input type="text" v-model="keyword" placeholder="搜索商品" placeholder-style="color:#949494" <input
@confirm="search"> v-model="keyword"
<image class="icon" :src="webUrl+'/20220903142935869059.png'" mode="scaleToFill" type="text"
@click="search"></image> placeholder="搜索商品"
placeholder-style="color:#949494"
@confirm="searchHandle"
>
<image
class="icon"
:src="webUrl+'/20220903142935869059.png'"
mode="scaleToFill"
@click="searchHandle"></image>
</view> </view>
<u-tabs :list="tabList" keyName="cateName" lineColor="#D30808"
:activeStyle="{color:'#FFFFFF',fontWeight:'bold'}"
:inactiveStyle="{color:'rgba(255,255,255,.6)'}"
lineWidth="120rpx" @click="tabsTap"></u-tabs>
</view> </view>
<view class="line-location flex ai-center">
<image :src="webUrl+'/20220903142929759087.png'" mode="scaleToFill"></image>
<text class="bold">当前城市{{ cityName }}</text>
</view>
<view class="body-box"> <view class="body-box">
<view class="aside-box flex-0">
<view class="item flex jc-center ai-center" :class="index === asideIndex ? 'active' : ''"
v-for="(item, index) in asideList" :key="index" @click="asideTap(index)">
<text class="one-t">{{ item.cateName }}</text>
</view>
</view>
<view class="article-box"> <view class="article-box">
<view class="line-location flex ai-center"> <scroll-view
<image :src="webUrl+'/20220903142929759087.png'" mode="scaleToFill"></image> :style="{'height':listHeight}"
<!-- @click="goCity"--> :enable-flex="true"
<text class="bold">当前城市{{ cityName }}</text> :scroll-anchoring="true"
</view> :scroll-y="true"
:scroll-with-animation="true"
<scroll-view class="list flex flex-wrap" :style="{'height':listHeight}" :enable-flex="true" :enable-back-to-top="true"
:scroll-anchoring="true" class="list flex flex-wrap"
:scroll-y="true" @scrolltolower="onLower"
:scroll-with-animation="true" :enable-back-to-top="true" @scrolltolower="onLower"> >
<view class="item" @click="$global.navToGoods(item.id)" v-for="(item, index) in dataList" <view
:key="index"> v-for="(item, index) in dataList"
<image class="cover" :src="item.image" mode="scaleToFill"/> :key="index"
class="item"
@click="goodItemClick(item.id)"
>
<image
:src="item.image"
class="cover"
mode="scaleToFill"
/>
<view class="name more-t">{{ item.storeName }}</view> <view class="name more-t">{{ item.storeName }}</view>
<view class="price bold">{{ item.price }}</view> <view class="price bold">{{ item.price }}</view>
</view> </view>
</scroll-view> </scroll-view>
<image
<image class="img-nodata" :src="webUrl+'/20231023131208675588.png'" mode="scaleToFill" v-if="dataList.length===0"/> v-if="dataList.length === 0"
:src="webUrl + '/20231023131208675588.png'"
class="img-nodata"
mode="scaleToFill"
/>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import {fetchNormal, getCategory} from "@/api/store"; // 特产-城市商品列表
import { fetchNormal, getCategory } from "@/api/store"
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "nativeList", name: 'NativeListPage',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
keyword: "", keyword: '',
asideList: [], dataList: [],
asideIndex: 0,
dataList: [], // 列表数据
tabList: [],
cityId: null, cityId: null,
cityName: "", cityName: '',
page: 1, page: 1,
listHeight: "auto" listHeight: 'auto',
loading: false,
pageKeyId: ''
} }
}, },
onLoad(option) { onLoad(option) {
this.cityId = option.cityId; const cityId = option.cityId
this.init(); this.cityId = cityId
this.pageKeyId = `goodsProductList_cityId_${cityId}`
this.init()
}, },
methods: { methods: {
goCity() {
uni.redirectTo({
url: `/pages/chose-city/chose-city?type=0&city=${this.cityName}`
})
},
init() { init() {
getCategory(0, 35, this.cityId, true).then(({data}) => { const memCityName = uni.getStorageSync('cityName')
this.tabList = data; if (memCityName.length) {
this.asideList = data[0].children; this.cityName = memCityName
let memCityName = uni.getStorageSync("cityName") uni.removeStorageSync('cityName')
if (memCityName.length) { }
this.cityName = memCityName; this.search(1)
uni.removeStorageSync("cityName")
}
this.search();
});
}, },
onLower() { onLower() {
this.page++; if (this.loading) {
this.search(); return
}
this.page++
this.search()
},
searchHandle() {
// fix bug#1828
this.page = 1
this.search()
}, },
search() { search() {
let that = this; const _this = this
let param = { _this.loading = true
fetchNormal({
isGood: 1, isGood: 1,
page: this.page, page: _this.page,
keyword: this.keyword, keyword: _this.keyword,
cityName: this.cityName, cityName: _this.cityName
sid: this.asideList[this.asideIndex].id }).then(({data}) => {
}; if (_this.page === 1) {
_this.dataList = []
fetchNormal(param).then(({data}) => {
if (this.page === 1) {
this.dataList = [];
} }
this.dataList = this.dataList.concat(data); _this.dataList = _this.dataList.concat(data)
_this.loading = false
uni.getSystemInfo({ uni.getSystemInfo({
success: function (res) { success: function (res) {
let len = that.dataList.length; const len = _this.dataList.length
let {windowHeight} = res; const { windowHeight } = res
that.listHeight = "auto"; _this.listHeight = 'auto'
if (windowHeight > 600 && len > 6) { if (windowHeight > 600 && len > 6) {
that.listHeight = "100%"; _this.listHeight = '100%'
} }
if (windowHeight <= 600 && len > 4) { if (windowHeight <= 600 && len > 4) {
that.listHeight = "100%"; _this.listHeight = '100%'
} }
} }
}); })
}).catch(err => { }).catch(err => {
_this.loading = false
uni.showToast({ uni.showToast({
title: err + '', title: err + '',
icon: 'none', icon: 'none',
mask: false, mask: false,
duration: 1500 duration: 1500
}); })
}) })
}, },
tabsTap(item) { goodItemClick(productId) {
this.asideList = item.children; if (!productId) {
this.asideIndex = 0; return
this.page = 1; }
this.search(); uni.navigateTo({
}, url: `/pages/shop/GoodsCon/index?id=${productId}&from=techan`
asideTap(index) { })
this.asideIndex = index;
this.page = 1;
this.search();
} }
} }
} }
@@ -152,13 +162,16 @@ export default {
overflow-y: hidden; overflow-y: hidden;
.top-box { .top-box {
height: 142rpx; height: 82rpx;
background: #FF564A; background: #FF564A;
} }
.line-location { .line-location {
height: 90rpx;
padding: 20rpx; padding: 20rpx;
box-sizing: border-box;
font-size: 28rpx; font-size: 28rpx;
background-color: #fff;
image { image {
width: 36rpx; width: 36rpx;
@@ -168,11 +181,21 @@ export default {
} }
.body-box { .body-box {
height: calc(100vh - 142rpx); height: calc(100vh - 82rpx - 90rpx);
box-sizing: border-box;
.article-box { .article-box {
width: 100%;
.list {
padding: 0 0 20rpx 0;
}
.item { .item {
height: 362rpx; width: 345rpx;
height: 465rpx;
.cover {
width: 345rpx;
height: 345rpx;
}
} }
} }
} }
@@ -0,0 +1,189 @@
<template>
<view class="pkg-product-list">
<view class="top-box">
<view class="search-box flex jc-between ai-center">
<input type="text" v-model="keyword" placeholder="搜索商品" placeholder-style="color:#949494"
@confirm="search">
<image class="icon" :src="webUrl+'/20220903142935869059.png'" mode="scaleToFill"
@click="search"></image>
</view>
<u-tabs :list="tabList" keyName="cateName" lineColor="#D30808"
:activeStyle="{color:'#FFFFFF',fontWeight:'bold'}"
:inactiveStyle="{color:'rgba(255,255,255,.6)'}"
lineWidth="120rpx" @click="tabsTap"></u-tabs>
</view>
<view class="body-box">
<view class="aside-box flex-0">
<view class="item flex jc-center ai-center" :class="index === asideIndex ? 'active' : ''"
v-for="(item, index) in asideList" :key="index" @click="asideTap(index)">
<text class="one-t">{{ item.cateName }}</text>
</view>
</view>
<view class="article-box">
<view class="line-location flex ai-center">
<image :src="webUrl+'/20220903142929759087.png'" mode="scaleToFill"></image>
<!-- @click="goCity"-->
<text class="bold">当前城市{{ cityName }}</text>
</view>
<scroll-view class="list flex flex-wrap" :style="{'height':listHeight}" :enable-flex="true"
:scroll-anchoring="true"
:scroll-y="true"
:scroll-with-animation="true" :enable-back-to-top="true" @scrolltolower="onLower">
<view class="item" @click="$global.navToGoods(item.id)" v-for="(item, index) in dataList"
:key="index">
<image class="cover" :src="item.image" mode="scaleToFill"/>
<view class="name more-t">{{ item.storeName }}</view>
<view class="price bold">{{ item.price }}</view>
</view>
</scroll-view>
<image class="img-nodata" :src="webUrl+'/20231023131208675588.png'" mode="scaleToFill" v-if="dataList.length===0"/>
</view>
</view>
</view>
</template>
<script>
import {fetchNormal, getCategory} from "@/api/store";
export default {
name: "nativeList",
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
keyword: "",
asideList: [],
asideIndex: 0,
dataList: [], // 列表数据
tabList: [],
cityId: null,
cityName: "",
page: 1,
listHeight: "auto"
}
},
onLoad(option) {
this.cityId = option.cityId;
this.init();
},
methods: {
goCity() {
uni.redirectTo({
url: `/pages/chose-city/chose-city?type=0&city=${this.cityName}`
})
},
init() {
getCategory(0, 35, this.cityId, true).then(({data}) => {
this.tabList = data;
this.asideList = data[0].children;
let memCityName = uni.getStorageSync("cityName")
if (memCityName.length) {
this.cityName = memCityName;
uni.removeStorageSync("cityName")
}
this.search();
});
},
onLower() {
this.page++;
this.search();
},
search() {
let that = this;
let param = {
isGood: 1,
page: this.page,
keyword: this.keyword,
cityName: this.cityName,
sid: this.asideList[this.asideIndex].id
};
fetchNormal(param).then(({data}) => {
if (this.page === 1) {
this.dataList = [];
}
this.dataList = this.dataList.concat(data);
uni.getSystemInfo({
success: function (res) {
let len = that.dataList.length;
let {windowHeight} = res;
that.listHeight = "auto";
if (windowHeight > 600 && len > 6) {
that.listHeight = "100%";
}
if (windowHeight <= 600 && len > 4) {
that.listHeight = "100%";
}
}
});
}).catch(err => {
uni.showToast({
title: err + '',
icon: 'none',
mask: false,
duration: 1500
});
})
},
tabsTap(item) {
this.asideList = item.children;
this.asideIndex = 0;
this.page = 1;
this.search();
},
asideTap(index) {
this.asideIndex = index;
this.page = 1;
this.search();
}
}
}
</script>
<style scoped lang="less">
@import "@/assets/css/product.less";
.pkg-product-list {
height: 100vh;
overflow-y: hidden;
.top-box {
height: 142rpx;
background: #FF564A;
}
.line-location {
padding: 20rpx;
font-size: 28rpx;
image {
width: 36rpx;
height: 36rpx;
margin-right: 4rpx;
}
}
.body-box {
height: calc(100vh - 142rpx);
.article-box {
.item {
height: 362rpx;
}
}
}
.img-nodata {
position: relative;
top: 200rpx;
left: 50%;
transform: translate(-50%, 0);
width: 352rpx;
height: 338rpx;
}
}
</style>
+20 -10
View File
@@ -1,9 +1,11 @@
<script> <script>
import {getSeason, getSeasonPoster} from "@/api/product"; import {getSeason, getSeasonPoster} from '@/api/product'
import cookie from "@/utils/store/cookie"; import cookie from '@/utils/store/cookie'
import {getUrlParam} from "@/utils/common.js"; import {getUrlParam} from '@/utils/common.js'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -12,15 +14,18 @@ export default {
info: null, info: null,
current: 0, current: 0,
showShare: false, showShare: false,
posterUrl: "", // 分享海报 posterUrl: '', // 分享海报
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
if (options.id) { const id = options.id
this.id = options.id || null; if (id) {
this.partnerId = options.partnerId || null; this.id = id || null
this.pageKeyId = `seasonalFoodContent_id_${id}`
this.partnerId = options.partnerId || null
} else { } else {
let obj = uni.getEnterOptionsSync(); const obj = uni.getEnterOptionsSync()
if (options.scene || obj.query.scene) { if (options.scene || obj.query.scene) {
let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene); let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene);
this.id = getUrlParam(query, "id") || null; this.id = getUrlParam(query, "id") || null;
@@ -131,7 +136,12 @@ export default {
} }
}) })
}, },
}, goGoods(id) {
uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${id}&from=season`
})
}
}
} }
</script> </script>
@@ -168,7 +178,7 @@ export default {
<image class="bg-img" :src="info.productImage" mode="widthFix"/> <image class="bg-img" :src="info.productImage" mode="widthFix"/>
<!-- <scroll-view scroll-y class="product-list" :style="{backgroundImage:'url(' + info.productImage + ')'}">--> <!-- <scroll-view scroll-y class="product-list" :style="{backgroundImage:'url(' + info.productImage + ')'}">-->
<scroll-view scroll-y class="product-list"> <scroll-view scroll-y class="product-list">
<image class="item" :src="item.image" mode="widthFix" @click="$global.navToGoods(item.id)" <image class="item" :src="item.image" mode="widthFix" @click="goGoods(item.id)"
v-for="(item,index) in info.products" :key="index"/> v-for="(item,index) in info.products" :key="index"/>
</scroll-view> </scroll-view>
</view> </view>
+9 -6
View File
@@ -1,31 +1,34 @@
<script> <script>
import {seasonHomeData} from "@/api/product"; import {seasonHomeData} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
typeList: ["时令果蔬", "水产海鲜", "肉禽蛋白", "全部分类"], typeList: ['时令果蔬', '水产海鲜', '肉禽蛋白', '全部分类'],
list: [], list: [],
typeIndex: 0 typeIndex: 0,
pageKeyId: Object.freeze('seasonalFoodIndex')
} }
}, },
onLoad() { onLoad() {
this.init(); this.init()
}, },
methods: { methods: {
changeType(index){ changeType(index){
this.typeIndex=index this.typeIndex=index
}, },
init() { init() {
seasonHomeData().then(({data}) => this.list = data.seasonalFoodType || []); seasonHomeData().then(({data}) => this.list = data.seasonalFoodType || [])
}, },
goDetail() { goDetail() {
uni.navigateTo({ uni.navigateTo({
url: "/pkg_product/views/season?id=" + this.list[this.typeIndex].contents[0].id url: "/pkg_product/views/season?id=" + this.list[this.typeIndex].contents[0].id
}) })
} }
}, }
} }
</script> </script>
+48 -59
View File
@@ -156,26 +156,27 @@
</template> </template>
<script> <script>
import CountDownUnit from "@/pkg_product/components/CountDownUnit.vue"; import CountDownUnit from '@/pkg_product/components/CountDownUnit.vue'
import {getSeckillRule, getSeckillTopList, getYxStoreSeckillIndex, getYxStoreSeckillPageList} from "@/api/goods"; import {getSeckillRule, getSeckillTopList, getYxStoreSeckillIndex, getYxStoreSeckillPageList} from '@/api/goods'
import {secKillShareImage} from "@/api/share"; import {secKillShareImage} from '@/api/share'
import {mapGetters} from "vuex"; import {mapGetters} from 'vuex'
import cookie from "@/utils/store/cookie"; import cookie from '@/utils/store/cookie'
import {userBindParent} from "@/api/user"; import {userBindParent} from '@/api/user'
import {getUrlParam} from "@/utils/common.js"; import {getUrlParam} from '@/utils/common.js'
import NoGoodData from '@/components/good/NoData' import NoGoodData from '@/components/good/NoData'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "seckill", name: 'Seckill',
components: { components: {
CountDownUnit, CountDownUnit,
NoGoodData NoGoodData
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
showRule: false, showRule: false,
seckillTime: [], seckillTime: [],
seckillTimeIndex: 0, seckillTimeIndex: 0,
page: 1, page: 1,
@@ -185,13 +186,14 @@ export default {
timeId: null, timeId: null,
nextList: [], nextList: [],
ruleContent: null, ruleContent: null,
partnerId: null partnerId: null,
pageKeyId: Object.freeze('seckillIndex')
} }
}, },
computed: mapGetters(["userInfo", "isLogin"]), computed: mapGetters(['userInfo', 'isLogin']),
onShareAppMessage() { onShareAppMessage() {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
const {status, data} = await secKillShareImage(); const {status, data} = await secKillShareImage()
if (status === 200) { if (status === 200) {
resolve({ resolve({
title: '探寻有趣有味的生活方式', title: '探寻有趣有味的生活方式',
@@ -203,91 +205,78 @@ export default {
}, },
onLoad(options) { onLoad(options) {
if (options.partnerId) { if (options.partnerId) {
this.partnerId = options.partnerId || null; this.partnerId = options.partnerId || null
} else { } else {
let obj = uni.getEnterOptionsSync(); let obj = uni.getEnterOptionsSync()
if (options.scene != null || obj.query.scene != null) { if (options.scene != null || obj.query.scene != null) {
let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene); let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene)
this.partnerId = getUrlParam(query, "partnerId") || null; this.partnerId = getUrlParam(query, 'partnerId') || null
} }
} }
if (this.partnerId) { if (this.partnerId) {
cookie.set("spread", this.partnerId); cookie.set('spread', this.partnerId)
userBindParent({spread: parseInt(this.partnerId)}); userBindParent({spread: parseInt(this.partnerId)})
} }
this.fetchSession()
this.fetchSession(); getSeckillRule().then(({data}) => this.ruleContent = data)
getSeckillRule().then(({data}) => this.ruleContent = data); getSeckillTopList(1, 10).then(({data}) => this.topList = data.records)
getSeckillTopList(1, 10).then(({data}) => this.topList = data.records);
}, },
onReachBottom() { onReachBottom() {
if (this.endReach) return; if (this.endReach) return
this.page++; this.page++
this.fetchList(); this.fetchList()
}, },
methods: { methods: {
changeRule(){ changeRule(){
this.showRule=!this.showRule this.showRule=!this.showRule
}, },
navChange(index) { navChange(index) {
if (this.seckillTimeIndex === index) return; if (this.seckillTimeIndex === index) return
this.seckillTimeIndex = index; this.seckillTimeIndex = index
this.page = 1; this.page = 1
this.list = []; this.list = []
this.timeId = this.seckillTime[this.seckillTimeIndex].id; this.timeId = this.seckillTime[this.seckillTimeIndex].id
this.endReach = false; this.endReach = false
this.fetchList() this.fetchList()
}, },
fetchSession() { fetchSession() {
getYxStoreSeckillIndex().then(({ getYxStoreSeckillIndex().then(({ data }) => {
data if (data.seckillTime.length === 0) return
}) => { this.seckillTime = data.seckillTime.filter(item => item.status > 0)
if (data.seckillTime.length === 0) return; this.timeId = this.seckillTime[this.seckillTimeIndex].id
this.fetchList()
this.seckillTime = data.seckillTime.filter(item => item.status > 0);
this.timeId = this.seckillTime[this.seckillTimeIndex].id;
this.fetchList();
if (this.seckillTime.length > this.seckillTimeIndex) { if (this.seckillTime.length > this.seckillTimeIndex) {
getYxStoreSeckillPageList(1, 10, this.seckillTime[this.seckillTimeIndex + 1].id).then(({ getYxStoreSeckillPageList(1, 10, this.seckillTime[this.seckillTimeIndex + 1].id).then(({ data }) => {
data this.nextList = data
}) => {
this.nextList = data;
}) })
} }
}); })
}, },
fetchList() { fetchList() {
getYxStoreSeckillPageList(this.page, 10, this.timeId).then(({ getYxStoreSeckillPageList(this.page, 10, this.timeId).then(({ data }) => {
data
}) => {
if (data.length > 0) { if (data.length > 0) {
data.map(item => this.list.push(item)); data.map(item => this.list.push(item));
} else { } else {
this.endReach = true; this.endReach = true
} }
}); })
}, },
goGoodsConByProductID(item, status) { goGoodsConByProductID(item, status) {
if (status > 1) { if (status > 1) {
uni.showToast({ uni.showToast({
title: "此商品秒杀活动还未开始哦", title: '此商品秒杀活动还未开始哦',
icon: "none" icon: 'none'
}) })
return; return
} }
this.$yrouter.push({ this.$yrouter.push({
path: '/pages/shop/GoodsCon/index', path: '/pages/shop/GoodsCon/index',
query: { query: {
id: item.productId, id: item.productId,
activityId: item.id, activityId: item.id,
from: "kill" from: 'kill'
} }
}); })
} }
} }
} }
+4 -2
View File
@@ -47,9 +47,10 @@
<script> <script>
import {bankList, addBankCard} from "@/api/user"; import {bankList, addBankCard} from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: {}, mixins: [pageListenMixins],
data: function () { data: function () {
return { return {
name: "", name: "",
@@ -59,7 +60,8 @@ export default {
bankList: [], bankList: [],
banks: [], banks: [],
index: 0, index: 0,
showPicker: false showPicker: false,
pageKeyId: Object.freeze('userBankCardEdit')
}; };
}, },
watch: {}, watch: {},
+4 -1
View File
@@ -56,8 +56,10 @@
import MescrollMixins from "@/mixins/mescroll-mixins.js"; import MescrollMixins from "@/mixins/mescroll-mixins.js";
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"; import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue";
import {getBank, postCashInfo, bankCardList, deleteBankCard} from "@/api/user"; import {getBank, postCashInfo, bankCardList, deleteBankCard} from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
list: [], list: [],
@@ -77,7 +79,8 @@ export default {
}, },
isSelectMode: false, isSelectMode: false,
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
bgColor: ["#FD574B", "#0DC5C5", "#3F57DA", "#FF4F48"] bgColor: ["#FD574B", "#0DC5C5", "#3F57DA", "#FF4F48"],
pageKeyId: Object.freeze('userBankCardIndex')
} }
}, },
components: { components: {
+4 -3
View File
@@ -25,16 +25,17 @@ import sendVerifyCode from "@/mixins/SendVerifyCode";
import {required, alpha_num, chs_phone} from "@/utils/validate"; import {required, alpha_num, chs_phone} from "@/utils/validate";
import {validatorDefaultCatch} from "@/utils/dialog"; import {validatorDefaultCatch} from "@/utils/dialog";
import {registerVerify, bindingPhoneByInput} from "@/api/user"; import {registerVerify, bindingPhoneByInput} from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "BindingPhone", name: "BindingPhone",
components: {}, mixins: [pageListenMixins],
props: {},
data: function () { data: function () {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
captcha: "", captcha: "",
phone: "" //手机号 phone: "",
pageKeyId: Object.freeze('userConfigPhone')
}; };
}, },
mixins: [sendVerifyCode], mixins: [sendVerifyCode],
+4 -1
View File
@@ -12,17 +12,20 @@
import SubSection from '@/components/SubSection.vue' import SubSection from '@/components/SubSection.vue'
import Coupons from '../components/Coupons.vue' import Coupons from '../components/Coupons.vue'
import {getCouponsUser} from '@/api/user' import {getCouponsUser} from '@/api/user'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "myCoupons", name: "myCoupons",
components: {SubSection, Coupons}, components: {SubSection, Coupons},
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
current: 0, current: 0,
canUse: 0, canUse: 0,
notUse: 0, notUse: 0,
list: [] list: [],
pageKeyId: Object.freeze('userCouponsIndex')
} }
}, },
onLoad() { onLoad() {
+29 -24
View File
@@ -126,9 +126,11 @@
import {getProductList, getStoreList, getVideoList, removeFavorite} from "@/api/favorite"; import {getProductList, getStoreList, getVideoList, removeFavorite} from "@/api/favorite";
import {postCartAdd} from "@/api/store"; import {postCartAdd} from "@/api/store";
import CheckboxIcon from "@/components/CheckboxIcon.vue"; import CheckboxIcon from "@/components/CheckboxIcon.vue";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: {CheckboxIcon}, components: {CheckboxIcon},
mixins: [pageListenMixins],
data() { data() {
return { return {
ready: false, ready: false,
@@ -145,6 +147,7 @@ export default {
productList: [], productList: [],
storeList: [], storeList: [],
videoList: [], videoList: [],
pageKeyId: Object.freeze('userCollectionIndex')
} }
}, },
computed: { computed: {
@@ -248,8 +251,29 @@ export default {
} }
}, },
async remove() { remove() {
let that = this const _this = this
const ids = []
switch (_this.tabsIndex) {
case 0:
_this.productList.forEach(item => {
if (item['state']) ids.push(item.id)
})
break
case 1:
_this.storeList.forEach(item => {
if (item['state']) ids.push(item.id)
})
break
case 2:
_this.videoList.forEach(item => {
if (item['state']) ids.push(item.id)
})
break
}
if (ids.length < 1) {
return
}
uni.showModal({ uni.showModal({
title: '确认删除已选项目?', title: '确认删除已选项目?',
content: '', content: '',
@@ -258,30 +282,11 @@ export default {
confirmText: '确认', confirmText: '确认',
success: async (r) => { success: async (r) => {
if (r.confirm) { if (r.confirm) {
let ids = []
switch (that.tabsIndex) {
case 0:
that.productList.forEach(item => {
if (item['state']) ids.push(item.id)
})
break
case 1:
that.storeList.forEach(item => {
if (item['state']) ids.push(item.id)
})
break
case 2:
that.videoList.forEach(item => {
if (item['state']) ids.push(item.id)
})
break
}
const res = await removeFavorite(ids) const res = await removeFavorite(ids)
if (res.success) { if (res.success) {
that.isAll = false _this.isAll = false
that.fetchData() _this.fetchData()
that.removeAfter() _this.removeAfter()
} }
} }
} }
+8 -1
View File
@@ -45,14 +45,17 @@ import sendVerifyCode from "@/mixins/SendVerifyCode";
import { required, alpha_num, chs_phone } from "@/utils/validate"; import { required, alpha_num, chs_phone } from "@/utils/validate";
import { validatorDefaultCatch } from "@/utils/dialog"; import { validatorDefaultCatch } from "@/utils/dialog";
import { getUserInfo, registerVerify, bindingPhone,modifyUserPayPwd } from "@/api/user"; import { getUserInfo, registerVerify, bindingPhone,modifyUserPayPwd } from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
captcha: "", captcha: "",
phone:'', phone:'',
payPwd:'' payPwd:'',
pageKeyId: Object.freeze('userConfigPasswordPay')
} }
}, },
mixins: [sendVerifyCode], mixins: [sendVerifyCode],
@@ -144,6 +147,10 @@ export default {
return validatorDefaultCatch(e); return validatorDefaultCatch(e);
} }
if (payPwd.length < 6) {
that.$dialog.toast({ mes: "请输入6位支付密码" })
return
}
//网络请求 //网络请求
uni.showLoading(); uni.showLoading();
modifyUserPayPwd({ modifyUserPayPwd({
+119 -128
View File
@@ -20,7 +20,11 @@
<view class="flex ai-center"> <view class="flex ai-center">
<view class="title">昵称</view> <view class="title">昵称</view>
<view class="value"> <view class="value">
<input type="text" v-model="userInfo.nickname"/> <input
v-model="nickname"
type="text"
maxlength="12"
/>
</view> </view>
</view> </view>
<view class="icon"> <view class="icon">
@@ -37,7 +41,51 @@
<image :src="webUrl+'/20220925102920713727.png'" style="width: 40rpx;height: 40rpx"/> <image :src="webUrl+'/20220925102920713727.png'" style="width: 40rpx;height: 40rpx"/>
</view> </view>
</view> </view>
<view class="cell flex jc-between ai-center">
<view class="flex ai-center">
<view class="title">性别</view>
<view class="value">
<u-radio-group
v-model="form.gender"
placement="row"
>
<u-radio
:name="1"
:customStyle="{marginRight: '16px'}"
active-color="#C41617"
label="男"
/>
<u-radio
:name="2"
active-color="#C41617"
label="女"
/>
</u-radio-group>
</view>
</view>
<view class="icon">
<image :src="webUrl+'/20220903145836941399.png'"/>
</view>
</view>
<view class="cell flex jc-between ai-center">
<view class="flex ai-center">
<view class="title">出生日期</view>
<view class="value">
<picker
:value="form.birthday"
mode="date"
class="picker"
@change="birthdayChange"
>
<u--text v-if="form.birthday" :text="form.birthday"></u--text>
<u--text v-else text="请选择" color="#c0c4cc"></u--text>
</picker>
</view>
</view>
<view class="icon">
<image :src="webUrl+'/20220903145836941399.png'"/>
</view>
</view>
<view class="cell flex jc-between ai-center" @click="bindPhone"> <view class="cell flex jc-between ai-center" @click="bindPhone">
<view class="flex ai-center"> <view class="flex ai-center">
<view class="title">手机号</view> <view class="title">手机号</view>
@@ -47,7 +95,6 @@
<image :src="webUrl+'/20220903145836941399.png'"/> <image :src="webUrl+'/20220903145836941399.png'"/>
</view> </view>
</view> </view>
<view class="cell flex jc-between ai-center" @click="payPwdClick"> <view class="cell flex jc-between ai-center" @click="payPwdClick">
<view class="flex ai-center"> <view class="flex ai-center">
<view class="title">支付密码</view> <view class="title">支付密码</view>
@@ -57,182 +104,124 @@
<image :src="webUrl+'/20220903145836941399.png'"/> <image :src="webUrl+'/20220903145836941399.png'"/>
</view> </view>
</view> </view>
</view> </view>
<button class="btn-save" @click="submit">保存修改</button> <button class="btn-save" @click="submit">保存修改</button>
<!-- <view-->
<!-- class="logOut cart-color acea-row row-center-wrapper"-->
<!-- @click="logout"-->
<!-- v-if="$deviceType=='app'"-->
<!-- >退出登录-->
<!-- </view>-->
</view> </view>
</template> </template>
<script> <script>
import {mapGetters} from "vuex"; import {mapGetters} from 'vuex'
import {isWeixin, trim, uploadImage} from "@/utils"; import {isWeixin, trim, uploadImage} from '@/utils'
import {postUserEdit} from "@/api/user"; import {postUserEdit} from '@/api/user'
import ImageCropper from "@/pkg_user/components/invinbg-image-cropper/invinbg-image-cropper.vue"; import ImageCropper from '@/pkg_user/components/invinbg-image-cropper/invinbg-image-cropper.vue'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "PersonalData", name: 'PersonalData',
components: { components: {
ImageCropper ImageCropper
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
avatar: "", avatar: '',
nickname: '',
isWeixin: false, isWeixin: false,
currentAccounts: 0, currentAccounts: 0,
switchUserInfo: [], switchUserInfo: [],
userIndex: 0, userIndex: 0,
tempFilePath: '', tempFilePath: '',
cropFilePath: '', cropFilePath: '',
}; pageKeyId: Object.freeze('userConfig'),
form: {
gender: '',
birthday: ''
}
}
}, },
computed: mapGetters(["userInfo"]), computed: mapGetters(['userInfo']),
mounted: function () { mounted: function () {
this.avatar = this.userInfo.avatar; this.avatar = this.userInfo.avatar
this.isWeixin = isWeixin(); this.nickname = this.userInfo.nickname
this.form.gender = this.userInfo.gender
this.form.birthday = this.userInfo.birthday || ''
this.isWeixin = isWeixin()
}, },
onShow: function () { onShow: function () {
//获取用户信息 // 获取用户信息
this.$store.dispatch("getUser", true); this.$store.dispatch('getUser', true)
}, },
methods: { methods: {
confirm(e) { confirm(e) {
this.tempFilePath = ''; this.tempFilePath = ''
this.cropFilePath = e.detail.tempFilePath; this.cropFilePath = e.detail.tempFilePath
uploadImage(this.cropFilePath, img => { uploadImage(this.cropFilePath, img => {
console.log(img) console.log(img)
this.avatar = img; this.avatar = img
this.cropFilePath = ''; this.cropFilePath = ''
}) })
}, },
cancel() { cancel() {
console.log('canceled') console.log('canceled')
}, },
bindPhone: function () { bindPhone: function () {
this.$yrouter.push("/pkg_user/views/bindPhone"); this.$yrouter.push('/pkg_user/views/bindPhone')
}, },
payPwdClick: function () { payPwdClick: function () {
//先判断用户是否绑定过手机 // 先判断用户是否绑定过手机
if (this.userInfo.phone) { if (this.userInfo.phone) {
//再判断用户是否设置过支付密码 // 再判断用户是否设置过支付密码
if (this.userInfo.hasPwdPay) { if (this.userInfo.hasPwdPay) {
//修改支付密码 // 修改支付密码
this.$yrouter.push("/pkg_user/views/payPassword"); this.$yrouter.push('/pkg_user/views/payPassword');
} else { } else {
//设置支付密码 // 设置支付密码
this.$yrouter.push("/pkg_user/views/payPassword?isSetMode=true"); this.$yrouter.push('/pkg_user/views/payPassword?isSetMode=true');
} }
} else { } else {
//跳转到绑定手机 // 跳转到绑定手机
this.$yrouter.push("/pkg_user/views/bindPhone"); this.$yrouter.push('/pkg_user/views/bindPhone');
} }
}, },
// switchAccounts: function (index) {
// let that = this;
// this.userIndex = index;
// let userInfo = this.switchUserInfo[this.userIndex];
// if (this.switchUserInfo.length <= 1) return true;
// if (userInfo === undefined) {
// uni.showToast({
// title: "切换的账号不存在",
// icon: "none",
// duration: 2000
// });
// return;
// }
// if (userInfo.user_type === "h5") {
// switchH5Login()
// .then(({data}) => {
// uni.hideLoading();
// const expires_time = dayjs(data.expires_time);
// store.commit("login", data.token, expires_time);
// that.$emit("changeswitch", false);
// location.reload();
// })
// .catch(err => {
// uni.hideLoading();
// uni.showToast({
// title:
// err.msg || err.response.data.msg || err.response.data.message,
// icon: "none",
// duration: 2000
// });
// });
// } else {
// cookie.set("loginType", "wechat", 60);
// uni.hideLoading();
// this.$store.commit("logout");
// this.$emit("changeswitch", false);
// }
// },
chooseImage() { chooseImage() {
uni.chooseImage({ uni.chooseImage({
count: 1, //默认9 count: 1,
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sizeType: ['original', 'compressed'],
sourceType: ['album'], //从相册选择 sourceType: ['album'],
success: (res) => { success: (res) => {
this.tempFilePath = res.tempFilePaths.shift() this.tempFilePath = res.tempFilePaths.shift()
} }
}); })
},
birthdayChange(e) {
this.form.birthday = e.detail.value
}, },
submit: function () { submit: function () {
let userInfo = this.userInfo; const that = this
let that = this;
postUserEdit({ postUserEdit({
nickname: trim(this.userInfo.nickname), nickname: trim(this.nickname),
avatar: this.avatar avatar: this.avatar,
}).then( gender: this.form.gender,
res => { birthday: this.form.birthday
that.$store.dispatch("userInfo", true); }).then(res => {
uni.showToast({ that.$store.dispatch('userInfo', true)
title: res.msg, uni.showToast({
icon: "none", title: res.msg,
duration: 2000 icon: 'none',
}); duration: 2000
setTimeout(function () { })
that.$yrouter.back(); setTimeout(function () {
}, 2000) that.$yrouter.back()
}, }, 2000)
err => { }, err => {
uni.showToast({ uni.showToast({
title: title: err.msg || err.response.data.msg || err.response.data.message,
err.msg || err.response.data.msg || err.response.data.message, icon: 'none',
icon: "none", duration: 2000
duration: 2000 })
}); })
} }
);
},
// logout: function () {
// uni.showModal({
// title: "提示",
// content: "确认退出登录?",
// success: function (res) {
// if (res.confirm) {
// getLogout()
// .then(res => {
// this.$store.commit("logout");
// this.$yrouter.replace({
// path: "/pages/user/Login/index",
// query: {}
// });
// })
// .catch(() => {
// })
// }
// }
// });
// }
} }
} }
</script> </script>
@@ -287,7 +276,6 @@ export default {
.cell-box { .cell-box {
width: 686rpx; width: 686rpx;
height: 406rpx;
margin: -130rpx 32rpx 0; margin: -130rpx 32rpx 0;
padding: 0 40rpx 20rpx; padding: 0 40rpx 20rpx;
box-shadow: 0 6rpx 12rpx rgba(0, 0, 0, 0.16); box-shadow: 0 6rpx 12rpx rgba(0, 0, 0, 0.16);
@@ -314,6 +302,9 @@ export default {
color: #999999; color: #999999;
font-size: 32rpx; font-size: 32rpx;
line-height: 48rpx; line-height: 48rpx;
.picker {
width: 400rpx;
}
} }
.icon { .icon {
+19 -6
View File
@@ -28,6 +28,7 @@
:customStyle="{ :customStyle="{
'border': 0 'border': 0
}" }"
:disabled="commissionCount <= 0"
placeholder-style="font-size:28rpx" placeholder-style="font-size:28rpx"
type="digit" type="digit"
autofocus autofocus
@@ -35,7 +36,11 @@
@input="balanceInputChange" @input="balanceInputChange"
/> />
</view> </view>
<view class="withdraw-all-btn" @click="withdrawalAll">全部提现</view> <view
:class="commissionCount <= 0 ? 'grey' : ''"
class="withdraw-all-btn"
@click="withdrawalAll"
>全部提现</view>
</view> </view>
<view class="vline"></view> <view class="vline"></view>
<view class="acea-row row-between row-middle" style="margin-top: 22rpx;"> <view class="acea-row row-between row-middle" style="margin-top: 22rpx;">
@@ -74,8 +79,10 @@ import { getBank, bankCardList, postCashInfo } from "@/api/user";
import NP from "number-precision"; import NP from "number-precision";
import uniPopup from '@/components/uni-popup/uni-popup.vue'; import uniPopup from '@/components/uni-popup/uni-popup.vue';
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue'; import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue';
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -89,7 +96,8 @@ export default {
gdAmount: 0, //固定手续费 gdAmount: 0, //固定手续费
gdLimit: 0, //最低固定费率额度 gdLimit: 0, //最低固定费率额度
feeRate: 0, //手续费费率 feeRate: 0, //手续费费率
remark: "" //提现说明 remark: "", //提现说明
pageKeyId: Object.freeze('userExtractIndex')
} }
}, },
components: { components: {
@@ -199,7 +207,7 @@ export default {
}, },
balanceInputChange(value) { balanceInputChange(value) {
let v = this.clearNoNum(value) let v = this.clearNoNum(value)
if (v > this.commissionCount) { if (v >= this.commissionCount) {
v = this.commissionCount v = this.commissionCount
} }
setTimeout(() => { setTimeout(() => {
@@ -207,8 +215,9 @@ export default {
}, 0) }, 0)
}, },
balanceInputBlur(value) { balanceInputBlur(value) {
console.log(value)
if (String(value).length == 0) { if (String(value).length == 0) {
this.amout = 0 this.amout = ''
return return
} }
if (value > this.commissionCount) { if (value > this.commissionCount) {
@@ -345,7 +354,7 @@ export default {
}); });
}, },
withdrawalAll: function () { withdrawalAll: function () {
if (this.commissionCount) { if (parseFloat(this.commissionCount) > 0) {
this.amout = this.commissionCount + '' this.amout = this.commissionCount + ''
} }
}, },
@@ -354,7 +363,7 @@ export default {
res => { res => {
this.banks = res.data.extractBank this.banks = res.data.extractBank
this.minPrice = res.data.minPrice this.minPrice = res.data.minPrice
this.commissionCount = this.$force2Decimal(res.data.commissionCount) this.commissionCount = parseFloat(this.$force2Decimal(res.data.commissionCount))
this.gdAmount = parseFloat(res.data.gdAmount) this.gdAmount = parseFloat(res.data.gdAmount)
this.gdLimit = parseFloat(res.data.gdLimit) this.gdLimit = parseFloat(res.data.gdLimit)
this.feeRate = parseFloat(res.data.fl) this.feeRate = parseFloat(res.data.fl)
@@ -432,6 +441,10 @@ export default {
text-align: center; text-align: center;
box-shadow: none; box-shadow: none;
background: #28AAF4; background: #28AAF4;
&.grey {
background-color: #f1f1f1;
color: #dcdcdc;
}
} }
.vline { .vline {
+3
View File
@@ -33,14 +33,17 @@
<script> <script>
import {payoutLog} from "@/api/user"; import {payoutLog} from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
ready: false, ready: false,
list: [], list: [],
page: 1, page: 1,
pageKeyId: Object.freeze('userExtractRecords')
} }
}, },
mounted() { mounted() {
@@ -551,7 +551,7 @@
} }
&--disabled { &--disabled {
opacity: $u-upload-disabled-opacity; opacity: 0;
} }
} }
} }
+24 -16
View File
@@ -18,13 +18,18 @@ fly.interceptors.response.use(
console.log('————————') console.log('————————')
handleLoginFailure(); handleLoginFailure();
return Promise.reject({msg: "未登录", toLogin: true}); return Promise.reject({msg: "未登录", toLogin: true});
} } else if (error.status == 401) {
if (error.status == 401) {
console.log('————————') console.log('————————')
console.log('登录失效 401', error) console.log('登录失效 401', error)
console.log('————————') console.log('————————')
handleLoginFailure(); handleLoginFailure();
return Promise.reject({msg: "未登录", toLogin: true}); return Promise.reject({msg: "未登录", toLogin: true});
} else {
uni.showToast({
title: '服务开小差了,请稍后再试',
icon: 'none',
duration: 3000
})
} }
return Promise.reject(error); return Promise.reject(error);
} }
@@ -51,24 +56,27 @@ function baseRequest(options) {
return fly.request(url, params || data, { return fly.request(url, params || data, {
...option ...option
}).then(res => { }).then(res => {
const data = res.data || {}; const resData = res.data || {};
if (res.status !== 200) { if (res.status !== 200) {
return Promise.reject({msg: "请求失败", res, data}); return Promise.reject({msg: "请求失败", res, resData});
} }
if ([401, 403].indexOf(data.status) !== -1) { if ([401, 403].indexOf(resData.status) !== -1) {
handleLoginFailure(); handleLoginFailure();
return Promise.reject({msg: res.data.msg, res, data, toLogin: true}); return Promise.reject({msg: res.data.msg, res, resData, toLogin: true});
} else if (data.status === 200) { } else if (resData.status === 200) {
return Promise.resolve(data, res); return Promise.resolve(resData, res);
} else { } else {
uni.showToast({ // 埋点数据推送、获取店铺分享图片
title: res.data.msg, if (url.indexOf('api/systemStats/push') < 0 && url.indexOf('api/hotelMain/shareImage') < 0) {
icon: 'none', uni.showToast({
duration: 3000, title: resData.msg,
success() { icon: 'none',
} duration: 3000,
}) success() {
return Promise.reject({msg: res.data.msg, res, data}); }
})
}
return Promise.reject({msg: resData.msg, res, data});
} }
}); });
} }
+4 -4
View File
@@ -1,4 +1,5 @@
import { trim, isType } from "@/utils"; import { trim, isType } from "@/utils";
import { pageViewDataCacheKey } from '@/config/index'
const doc = null; const doc = null;
// const doc = window.document; // const doc = window.document;
@@ -30,15 +31,14 @@ function remove(key) {
function clearAll() { function clearAll() {
// uni.clearStorage() // uni.clearStorage()
const res = uni.getStorageInfoSync(); const res = uni.getStorageInfoSync()
res.keys.map((item) => { res.keys.map((item) => {
//不要清除spread和redirect // 不要清除spread和redirect、页面埋点数据
if (item == 'redirect' || item == 'spread') { if ([pageViewDataCacheKey, 'redirect', 'spread'].includes(item)) {
return return
} }
remove(item) remove(item)
}) })
console.log(res)
} }
function _has(key) { function _has(key) {
+163
View File
@@ -1,3 +1,7 @@
import Vue from 'vue'
import { pushSystemStatic } from '@/api/public'
import { pageViewDataCacheKey } from '@/config/index'
// 日期格式化 // 日期格式化
export function formatterDate(date, flag = '-', mode = 'date') { export function formatterDate(date, flag = '-', mode = 'date') {
const year = new Date(date).getFullYear() const year = new Date(date).getFullYear()
@@ -22,3 +26,162 @@ export function formatContent(html) {
contentData = contentData.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;margin:0 auto;"') contentData = contentData.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;margin:0 auto;"')
return contentData return contentData
} }
/**
* desc: 监听页面访问次数
* auth: lifizer
* date: 2024-05-16
* @param key-页面唯一标识
* @param cb-回调函数
* @returns {null}
*/
export function pageToWatchShowCount(key, cb = '') {
if (!key) {
return
}
if (!Vue.prototype.$pageToWatchData[key]) {
Vue.prototype.$pageToWatchData[key] = []
}
console.log('页面监听-----%s', key)
cb && cb()
}
/**
* desc: 监听页面访问时长
* auth: lifizer
* date: 2024-05-16
* @param key-页面唯一标识
* @returns {null}
*/
export function pageToWatchShowTimer(key, data) {
if (!key) {
return
}
if (Vue.prototype.$pageToWatchData[key]) {
Vue.prototype.$pageToWatchData[key].push(data)
}
const userInfo = uni.getStorageSync('userInfo')
if (!userInfo) {
uni.setStorageSync(pageViewDataCacheKey, Vue.prototype.$pageToWatchData)
}
}
/**
* desc: 获取缓存页面埋点数据
* auth: lifizer
* date: 2024-06-16
* @returns {data}
*/
export function getPageViewDataToLocalCache() {
let data = {}
if (uni.setStorageSync(pageViewDataCacheKey)) {
data = uni.setStorageSync(pageViewDataCacheKey)
}
return data
}
/**
* desc: 获取当前系统时间
* auth: lifizer
* date: 2024-05-16
* @returns {String}
*/
export function getCurrDateTime() {
const date = new Date()
let str = ''
str += date.getFullYear() + '-'
str += (date.getMonth() + 1).toString().padStart(2, '0') + '-'
str += (date.getDate()).toString().padStart(2, '0') + ' '
str += (date.getHours()).toString().padStart(2, '0') + ':'
str += (date.getMinutes()).toString().padStart(2, '0') + ':'
str += (date.getSeconds()).toString().padStart(2, '0')
return str
}
/**
* desc: 计算两个时间的相差的秒数
* auth: lifizer
* date: 2024-05-16
* @param startValue-开始时间
* @param endValue-结束时间
* @returns {null}
*/
export function TimeDifference(startValue, endValue) {
const startYear = parseInt(startValue.substring(0, 4))
const startMonth = parseInt(startValue.substring(5, 7)) - 1
const startDate = parseInt(startValue.substring(8, 10))
const startHours = parseInt(startValue.substring(11, 13))
const startMinutes = parseInt(startValue.substring(14, 16))
const startSeconds = parseInt(startValue.substring(17, 19))
const endYear = parseInt(endValue.substring(0, 4))
const endMonth = parseInt(endValue.substring(5, 7)) - 1
const endDate = parseInt(endValue.substring(8, 10))
const endHours = parseInt(endValue.substring(11, 13))
const endMinutes = parseInt(endValue.substring(14, 16))
const endSeconds = parseInt(endValue.substring(17, 19))
const startTime = (new Date(startYear, startMonth, startDate, startHours, startMinutes, startSeconds)).getTime()
const endTime = (new Date(endYear, endMonth, endDate, endHours, endMinutes, endSeconds)).getTime()
return (endTime - startTime) / 1000
}
/**
* 清楚所有的定时器
* @returns {null}
*/
export function clearAllInterval() {
const endTimerId = setInterval(function() {
console.log('clear all timer...')
}, 1000)
for (let i = 1; i <= endTimerId; i++) {
clearInterval(i)
}
pushSysBySecondsHandle()
}
/**
* 定时推送埋点
* @returns {null}
*/
function pushSysBySecondsHandle() {
setInterval(() => {
const userInfo = uni.getStorageSync('userInfo')
if (!userInfo) {
return
}
let statsData = []
for (const key in Vue.prototype.$pageToWatchData) {
if (Vue.prototype.$pageToWatchData[key]) {
statsData = statsData.concat(Vue.prototype.$pageToWatchData[key])
}
}
if (statsData.length < 1) {
console.log('*************没有页面埋点数据则不用上报,节约网络请求')
return
}
// 设备类型phone、pad、pc、unknow
const deviceType = uni.getSystemInfoSync().deviceType
// 系统名称ios、android
const osName = uni.getSystemInfoSync().osName
console.log(deviceType)
console.log(osName)
const postData = {
uid: userInfo.uid,
deviceType: deviceType === 'phone' ? osName : 'unknown',
statsData
}
console.log('开始上报数据-------------------')
pushSystemStatic(postData).then(res => {
const { success } = res
if (success) {
// 上报成功之后清空上一次的页面埋点数据
for (const key in Vue.prototype.$pageToWatchData) {
Vue.prototype.$pageToWatchData[key] = []
}
console.log('*************清除上次未登录缓存的页面埋点数据')
uni.removeStorageSync(pageViewDataCacheKey)
}
}).catch(err => {
console.log(err)
})
}, 30 * 1000)
}
+4 -1
View File
@@ -57,11 +57,13 @@ import {getAttract, investment, saveAttract} from "@/api/shop.js";
// import { // import {
// queryByType // queryByType
// } from "@/api/public"; // } from "@/api/public";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: { components: {
CitySelect CitySelect
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -80,7 +82,8 @@ export default {
investmentTopImage: null, investmentTopImage: null,
investmentMainImage: null, investmentMainImage: null,
investmentBottomImage: null, investmentBottomImage: null,
investmentTitle: "" investmentTitle: "",
pageKeyId: Object.freeze('investmentIndex')
} }
}, },
onLoad: function () { onLoad: function () {
+13 -10
View File
@@ -22,32 +22,35 @@
</template> </template>
<script> <script>
import {investmentInfo} from "@/api/shop"; import {investmentInfo} from '@/api/shop'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "project", name: 'ProjectDetail',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
id: null, id: null,
info: null info: null,
pageKeyId: ''
} }
}, },
onLoad(option) { onLoad(option) {
this.id = option.id; const id = option.id
this.init(); this.id = id
this.pageKeyId = `investmentInfo_id_${id}`
this.init()
}, },
methods: { methods: {
init() { init() {
investmentInfo(this.id).then(({data}) => this.info = data); investmentInfo(this.id).then(({data}) => this.info = data)
}, },
viewFile(item) { viewFile(item) {
if (item.suffix === "pdf") { if (item.suffix === 'pdf') {
uni.downloadFile({ uni.downloadFile({
url: item.attachment, url: item.attachment,
success: res => { success: res => {
let filePath = res.tempFilePath; const filePath = res.tempFilePath
uni.openDocument({ uni.openDocument({
filePath filePath
}) })
+24 -25
View File
@@ -1,7 +1,7 @@
<template> <template>
<view class="v4-project-list"> <view class="v4-project-list">
<view class="search-box flex jc-between ai-center"> <view class="search-box flex jc-between ai-center">
<input type="text" v-model="keyword" placeholder="请输入项目名称"/> <input type="text" v-model="keyword" placeholder="请输入项目名称" @confirm="search"/>
<view class="btn flex jc-center ai-center" @click="search"> <view class="btn flex jc-center ai-center" @click="search">
<image :src="webUrl+'/20221019150834639123.png'"/> <image :src="webUrl+'/20221019150834639123.png'"/>
<text>搜索</text> <text>搜索</text>
@@ -20,26 +20,29 @@
</template> </template>
<script> <script>
import {investmentInfo, investmentList} from "@/api/shop"; import {investmentInfo, investmentList} from '@/api/shop'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "projectList", name: 'ProjectList',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
page: 1, // 当前页 page: 1, // 当前页
keyword: "", // 搜索词 keyword: '', // 搜索词
pages: 0, // 总页数 pages: 0, // 总页数
list: [], list: [],
os: "" os: '',
pageKeyId: Object.freeze('investmentList')
} }
}, },
mounted() { mounted() {
this.getOS(); this.getOS()
this.getData(); this.getData()
}, },
onReachBottom() { onReachBottom() {
if (this.pages >= this.page) this.getData(); if (this.pages >= this.page) this.getData()
}, },
methods: { methods: {
getOS() { getOS() {
@@ -47,39 +50,35 @@ export default {
success: result => this.os = result.osName success: result => this.os = result.osName
}) })
}, },
search() { search() {
this.list = []; this.list = []
this.page = 1; this.page = 1
this.getData(); this.getData()
}, },
getData() { getData() {
investmentList(this.page, this.keyword).then(({data}) => { investmentList(this.page, this.keyword).then(({data}) => {
this.pages = data.pages; this.pages = data.pages
this.page++; this.page++
if (data.records.length > 0) { if (data.records.length > 0) {
data.records.map(item => { data.records.map(item => {
this.list.push(item); this.list.push(item)
}) })
} }
}); })
}, },
getDetail(id) { getDetail(id) {
investmentInfo(id).then(({data}) => { investmentInfo(id).then(({data}) => {
const file = data.contents[0]; const file = data.contents[0];
if (file.suffix === "pdf" && this.os === "android") { if (file.suffix === 'pdf' && this.os === 'android') {
this.viewPdf(file.attachmentFiles[0]) this.viewPdf(file.attachmentFiles[0])
} else { } else {
let path = file.attachmentFiles[0]; let path = file.attachmentFiles[0];
uni.navigateTo({ uni.navigateTo({
url: "/pkg_common/views/pdf?path=" + encodeURI(path) url: '/pkg_common/views/pdf?path=' + encodeURI(path) + '&id=' + id
}) })
} }
}); })
}, },
viewPdf(url) { viewPdf(url) {
uni.downloadFile({ uni.downloadFile({
url,//可以是后台传过来的路径 url,//可以是后台传过来的路径
@@ -87,13 +86,13 @@ export default {
const filePath = res.tempFilePath const filePath = res.tempFilePath
uni.openDocument({ uni.openDocument({
filePath, filePath,
fileType: "pdf", fileType: 'pdf',
success: result => { success: result => {
//成功 //成功
}, },
fail: err => { fail: err => {
uni.showModal({ uni.showModal({
title: "openDocument fail", title: 'openDocument fail',
content: JSON.stringify(err) content: JSON.stringify(err)
}) })
} }
@@ -101,7 +100,7 @@ export default {
}, },
fail: err => { fail: err => {
uni.showModal({ uni.showModal({
title: "downloadFile fail", title: 'downloadFile fail',
content: JSON.stringify(err) content: JSON.stringify(err)
}) })
} }