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