Feat(页面):页面埋点配置

This commit is contained in:
lifizer
2024-06-17 23:13:22 +08:00
parent 19914b5b0d
commit cef0177716
55 changed files with 552 additions and 377 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ export const pageListenMixins = {
this.pageViewDateTime = getCurrDateTime() this.pageViewDateTime = getCurrDateTime()
this.pageToWatchShowCount(this.pageKeyId) this.pageToWatchShowCount(this.pageKeyId)
}, },
onHide() { onUnload() {
this.pageToHideHandle() this.pageToHideHandle()
}, },
methods: { methods: {
@@ -130,7 +130,7 @@ export default {
// this.videoContext = uni.createVideoContext('myVideo'); // this.videoContext = uni.createVideoContext('myVideo');
// this.videoContext.requestFullScreen(); // this.videoContext.requestFullScreen();
this.$yrouter.push('/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl='+video.video); this.$yrouter.push('/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl='+video.video + '&id=' + video.id);
}, },
liveClick:function(video){ liveClick:function(video){
var liveAppId = this.$WX_LIVE_APPID; var liveAppId = this.$WX_LIVE_APPID;
@@ -4,16 +4,18 @@
</view> </view>
</template> </template>
<script> <script>
import uniPopup from '@/components/uni-popup/uni-popup.vue'; import uniPopup from '@/components/uni-popup/uni-popup.vue'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components:{ components:{
uniPopup uniPopup
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
curPlayVideoUrl:'', curPlayVideoUrl:'',
isVideoPopupShow:false isVideoPopupShow:false,
pageKeyId: ''
} }
}, },
onReady: function(res) { onReady: function(res) {
@@ -21,10 +23,9 @@ export default {
this.videoContext.requestFullScreen(); this.videoContext.requestFullScreen();
}, },
onLoad:function(e){ onLoad:function(e){
this.curPlayVideoUrl = e.videoUrl
this.curPlayVideoUrl = e.videoUrl; const id = options.id
//this.$refs.popup.open(); this.pageKeyId = `findVideo_videoId_${id}`
}, },
methods: { methods: {
videoErrorCallback: function(e) { videoErrorCallback: function(e) {
+27 -29
View File
@@ -32,71 +32,69 @@
</template> </template>
<script> <script>
import {getStoreVideoType, getArticleList} from "@/api/public"; import {getStoreVideoType, getArticleList} from '@/api/public'
import {getVideoList} from "@/api/user"; import {getVideoList} from '@/api/user'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
typeList: [{"label": "全部", "value": ""}], typeList: [{'label': '全部', 'value': ''}],
type: "", type: '',
page: 1, page: 1,
limit: 10, limit: 10,
keyword: "", keyword: '',
list: [], list: [],
isWait: false isWait: false,
pageKeyId: Object.freeze('findVideoList')
} }
}, },
onLoad() { onLoad() {
this.getType(); this.getType()
this.fetchList(); this.fetchList()
}, },
onReachBottom() { onReachBottom() {
this.page++; this.page++
this.fetchList(); this.fetchList()
}, },
methods: { methods: {
getType() { getType() {
getStoreVideoType().then(({data}) => { getStoreVideoType().then(({data}) => {
if (data.length > 0) { if (data.length > 0) {
data.forEach(item => { data.forEach(item => {
this.typeList.push(item); this.typeList.push(item)
}) })
} }
}); })
}, },
changeType(item) { changeType(item) {
this.type = item.value; this.type = item.value
this.page = 1; this.page = 1
this.list = []; this.list = []
this.fetchList(); this.fetchList()
}, },
fetchList() { fetchList() {
if (this.isWait) return; if (this.isWait) return
this.isWait = true; this.isWait = true
const params = {
let params = {
type: this.type, type: this.type,
page: this.page, page: this.page,
limit: this.limit limit: this.limit
}; }
getVideoList(params).then(res => { getVideoList(params).then(res => {
if (res.status === 200) { if (res.status === 200) {
for (let i = 0; i < res.data.length; i++) { for (let i = 0; i < res.data.length; i++) {
res.data[i].hide = true; res.data[i].hide = true
this.list.push(res.data[i]) this.list.push(res.data[i])
} }
} }
this.isWait = false; this.isWait = false
}); })
}, },
goDetail(item) { goDetail(item) {
this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video); this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video + '&id=' + item.id)
} }
} }
} }
+7 -1
View File
@@ -225,10 +225,12 @@ import {
cartGoodChangeAttr cartGoodChangeAttr
} from '@/api/store' } from '@/api/store'
import CheckboxIcon from '@/components/CheckboxIcon.vue' import CheckboxIcon from '@/components/CheckboxIcon.vue'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: { components: {
CheckboxIcon CheckboxIcon
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
statusBarHeight: uni.getSystemInfoSync().statusBarHeight, statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
@@ -241,7 +243,8 @@ export default {
productAttr: [], productAttr: [],
productValueArr: [] productValueArr: []
}, },
showAttr: false showAttr: false,
pageKeyId: Object.freeze('landmarkGoodsIndex')
} }
}, },
computed: { computed: {
@@ -274,6 +277,9 @@ export default {
this.closeAttr() this.closeAttr()
this.getCart() this.getCart()
}, },
onHide() {
this.pageToHideHandle()
},
methods: { methods: {
async getCart() { async getCart() {
const res = await getCartGroup() const res = await getCartGroup()
+31 -8
View File
@@ -141,28 +141,27 @@ import MescrollMixins from '@/mixins/mescroll-mixins.js'
import {fetchCity} from '@/api/wenwan' import {fetchCity} from '@/api/wenwan'
import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue' import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue'
import {getCurAddress, getLocation} from '@/utils/common.js' import {getCurAddress, getLocation} from '@/utils/common.js'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'ChoseCity', name: 'ChoseCity',
components: { components: {
MescrollBody MescrollBody
}, },
props: {},
mixins: [ mixins: [
MescrollMixins({ MescrollMixins({
getPageData(mescroll) { getPageData(mescroll) {
// 此时mescroll会携带page的参数:
// let pageNum = mescroll.num; // 页码, 默认从1开始
// let pageSize = mescroll.size; // 页长, 默认每页10条
mescroll.endSuccess(10) mescroll.endSuccess(10)
} }
}) }),
pageListenMixins
], ],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
upOption: { upOption: {
noMoreSize: 10, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5 // 如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
noMoreSize: 10,
auto: false, auto: false,
empty: { empty: {
tip: '暂无城市' tip: '暂无城市'
@@ -176,14 +175,38 @@ export default {
listCity: [], listCity: [],
navActive: 0, navActive: 0,
keyword: '', keyword: '',
// 0、特产;1、文玩;2、七彩云上;3、特色礼品;4、康养食材;5、千县名品;6、景点门票
type: null, type: null,
location: '', location: '',
banner: {}, banner: {},
recommendInfo: null // 推荐信息 // 推荐信息
recommendInfo: null,
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.type = Number(options.type) const type = Number(options.type)
this.type = type
switch(type) {
case 0:
this.pageKeyId = 'goodsIndex'
break
case 1:
this.pageKeyId = 'wenwanIndex'
break
case 3:
this.pageKeyId = 'customizedGiftIndex'
break
case 4:
this.pageKeyId = 'wellnessFoodIndex'
break
case 5:
this.pageKeyId = 'countyFamousIndex'
break
default:
this.pageKeyId = ''
break
}
this.location = options.city this.location = options.city
if (this.location === undefined) { if (this.location === undefined) {
this.getMapData() this.getMapData()
+5 -2
View File
@@ -79,10 +79,12 @@
import { getHotelList, getHotelTypeList } from "@/api/inn.js" import { getHotelList, getHotelTypeList } from "@/api/inn.js"
import { getCurAddress, getLocation } from "@/utils/common" import { getCurAddress, getLocation } from "@/utils/common"
import FunHotelItem from './components/HotelItem' import FunHotelItem from './components/HotelItem'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: { components: {
FunHotelItem FunHotelItem
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -92,7 +94,8 @@ export default {
typeIndex: 0, typeIndex: 0,
cityName: '', cityName: '',
hotelList: [], hotelList: [],
isLoad: false isLoad: false,
pageKeyId: Object.freeze('findFunIndex')
} }
}, },
computed: { computed: {
@@ -132,7 +135,7 @@ export default {
}, },
goInnDetail(item) { goInnDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pagesInn/inn/innHome?id=${item.id}` url: `/pagesInn/inn/innHome?id=${item.id}&from=fun`
}) })
}, },
async getMapData() { async getMapData() {
+3
View File
@@ -415,6 +415,9 @@ export default {
// this.getBastList() // this.getBastList()
// } // }
}, },
onHide() {
this.pageToHideHandle()
},
onShareAppMessage() { onShareAppMessage() {
return { return {
title: '探寻有趣有味的生活方式', title: '探寻有趣有味的生活方式',
+11 -3
View File
@@ -26,7 +26,7 @@
:key="index" :key="index"
class="item" class="item"
:style="{'left':item.gx+'rpx','top':item.gy+'rpx'}" :style="{'left':item.gx+'rpx','top':item.gy+'rpx'}"
@click="$global.navToGoods(item.productId)" @click="goGoods(item.productId)"
> >
<view class="round"> <view class="round">
<view class="line" :class="'line-'+directionClass[item.labelDirection]"></view> <view class="line" :class="'line-'+directionClass[item.labelDirection]"></view>
@@ -48,7 +48,7 @@
</view> </view>
<view class="main-box" v-if="mapData.recommended.storeImage" <view class="main-box" v-if="mapData.recommended.storeImage"
@click="$global.navToGoods(mapData.recommended.productId)"> @click="goGoods(mapData.recommended.productId)">
<image class="bg-main" :src="mapData.recommended.storeImage" mode="scaleToFill"/> <image class="bg-main" :src="mapData.recommended.storeImage" mode="scaleToFill"/>
<view class="box-mask flex flex-col jc-end"> <view class="box-mask flex flex-col jc-end">
<view class="one-t bold">{{ mapData.recommended.title }}</view> <view class="one-t bold">{{ mapData.recommended.title }}</view>
@@ -57,7 +57,7 @@
</view> </view>
<view class="list-box flex flex-wrap"> <view class="list-box flex flex-wrap">
<view class="item" v-for="item in goods" :key="item.id" @click="$global.navToGoods(item.productId)"> <view class="item" v-for="item in goods" :key="item.id" @click="goGoods(item.productId)">
<image :src="item.storeImage" mode="scaleToFill"/> <image :src="item.storeImage" mode="scaleToFill"/>
<view class="content flex flex-col jc-between"> <view class="content flex flex-col jc-between">
<view class="more-t bold">{{ item.title }}</view> <view class="more-t bold">{{ item.title }}</view>
@@ -110,6 +110,9 @@ export default {
onLoad() { onLoad() {
this.getNavList(); this.getNavList();
}, },
onHide() {
this.pageToHideHandle()
},
onReachBottom() { onReachBottom() {
this.page++; this.page++;
this.fetchGoods(); this.fetchGoods();
@@ -159,6 +162,11 @@ export default {
this.goods.push(data[i]); this.goods.push(data[i]);
} }
}) })
},
goGoods(id) {
uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${id}&from=landmark`
})
} }
} }
} }
+88 -85
View File
@@ -44,99 +44,102 @@
</template> </template>
<script> <script>
import { import {
orderDetail, orderDetail,
getRefundReason, getRefundReason,
postOrderRefund postOrderRefund
} from "@/api/order"; } from "@/api/order";
import { import {
trim trim
} from "@/utils"; } from "@/utils";
import { import {
VUE_APP_API_URL VUE_APP_API_URL
} from "@/config"; } from "@/config";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "goodsReturn", name: "goodsReturn",
components: { components: {
// VueCoreImageUpload // VueCoreImageUpload
},
mixins: [pageListenMixins],
data() {
return {
url: `${VUE_APP_API_URL}/upload/image`,
headers: {
Authorization: "Bearer " + this.$store.state.token
},
id: 0,
orderInfo: {},
reasonList: [],
reason: "",
refundReasonWapExplain: "",
pageKeyId: Object.freeze('userOrderRefundApply')
};
},
methods: {
changeReason(e) {
this.reason = this.reasonList[e.mp.detail.value];
}, },
data() { getOrderDetail() {
return { orderDetail(this.id)
url: `${VUE_APP_API_URL}/upload/image`, .then(res => {
headers: { this.orderInfo = res.data;
Authorization: "Bearer " + this.$store.state.token })
}, .catch(err => {
id: 0,
orderInfo: {},
reasonList: [],
reason: "",
refundReasonWapExplain: ""
};
},
methods: {
changeReason(e) {
this.reason = this.reasonList[e.mp.detail.value];
},
getOrderDetail() {
orderDetail(this.id)
.then(res => {
this.orderInfo = res.data;
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
});
});
},
getRefundReason() {
getRefundReason().then(res => {
this.reasonList = res.data;
});
},
submit() {
const refundReasonWapExplain = trim(this.refundReasonWapExplain),
text = this.reason;
if (!text) {
uni.showToast({ uni.showToast({
title: "请选择退款原因", title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); });
return });
}
postOrderRefund({
text,
uni: this.orderInfo.orderId,
refundReasonWapExplain
})
.then(res => {
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
setTimeout(() => {
this.$yrouter.back();
}, 1500);
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
});
});
}
}, },
mounted() { getRefundReason() {
this.id = this.$yroute.query.id || 0; getRefundReason().then(res => {
this.getOrderDetail(); this.reasonList = res.data;
this.getRefundReason(); });
},
submit() {
const refundReasonWapExplain = trim(this.refundReasonWapExplain),
text = this.reason;
if (!text) {
uni.showToast({
title: "请选择退款原因",
icon: 'none',
duration: 2000
});
return
}
postOrderRefund({
text,
uni: this.orderInfo.orderId,
refundReasonWapExplain
})
.then(res => {
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
setTimeout(() => {
this.$yrouter.back();
}, 1500);
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
});
});
} }
}; },
mounted() {
this.id = this.$yroute.query.id || 0;
this.getOrderDetail();
this.getRefundReason();
}
};
</script> </script>
<style scoped> <style scoped>
.apply-return .list .item .inp { .apply-return .list .item .inp {
+3
View File
@@ -145,9 +145,11 @@ import {cancelOrderHandle, payOrderHandle, takeOrderHandle} from "@/libs/order";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import Payment from "@/components/Payment"; import Payment from "@/components/Payment";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "MyOrder", name: "MyOrder",
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -172,6 +174,7 @@ export default {
showExtend: false, showExtend: false,
delayId: null, delayId: null,
pageKeyId: Object.freeze('userOrderIndex')
}; };
}, },
components: { components: {
+4 -2
View File
@@ -265,6 +265,7 @@ import DataFormat from "@/components/DataFormat";
import {copyClipboard} from "@/utils"; import {copyClipboard} from "@/utils";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import {cancelOrderHandle, delOrderHandle, payOrderHandle, takeOrderHandle, yuePayOrderHandle} from "@/libs/order"; import {cancelOrderHandle, delOrderHandle, payOrderHandle, takeOrderHandle, yuePayOrderHandle} from "@/libs/order";
import { pageListenMixins } from '@/mixins/pageListenMixins'
const STATUS = [ const STATUS = [
"待付款", "待付款",
@@ -288,7 +289,7 @@ export default {
DataFormat, DataFormat,
passkeyborad passkeyborad
}, },
props: {}, mixins: [pageListenMixins],
data: function () { data: function () {
return { return {
isShowPayPwdPop: false, isShowPayPwdPop: false,
@@ -308,7 +309,8 @@ export default {
mapKay: "", mapKay: "",
mapShow: false, mapShow: false,
payPassword: null, payPassword: null,
webUrl: this.$VUE_APP_RESOURCES_URL webUrl: this.$VUE_APP_RESOURCES_URL,
pageKeyId: Object.freeze('userOrderInfo')
}; };
}, },
computed: { computed: {
+4 -1
View File
@@ -256,6 +256,7 @@ import {isNullOrEmpty, isWeixin} from "@/utils";
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue'; import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue';
import uniPopup from '@/components/uni-popup/uni-popup.vue'; import uniPopup from '@/components/uni-popup/uni-popup.vue';
import CouponsPopup from "@/components/CouponsPopup.vue" import CouponsPopup from "@/components/CouponsPopup.vue"
import { pageListenMixins } from '@/mixins/pageListenMixins'
const NAME = "OrderSubmission", const NAME = "OrderSubmission",
_isWeixin = isWeixin(); _isWeixin = isWeixin();
@@ -269,6 +270,7 @@ export default {
passkeyborad, passkeyborad,
CouponsPopup CouponsPopup
}, },
mixins: [pageListenMixins],
props: {}, props: {},
data: function () { data: function () {
return { return {
@@ -317,7 +319,8 @@ export default {
// 订单是否可以使用积分 // 订单是否可以使用积分
canUsePoints: false, canUsePoints: false,
// 订单最大可使用积分数量 // 订单最大可使用积分数量
maxPoints: 0 maxPoints: 0,
pageKeyId: Object.freeze('orderConfirm')
}; };
}, },
computed: mapGetters(["userInfo", "storeItems"]), computed: mapGetters(["userInfo", "storeItems"]),
+4 -1
View File
@@ -48,12 +48,14 @@
<script> <script>
import {getOrderList} from "@/api/order"; import {getOrderList} from "@/api/order";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "ReturnList", name: "ReturnList",
components: { components: {
Loading Loading
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -61,7 +63,8 @@ export default {
page: 1, page: 1,
limit: 20, limit: 20,
loading: false, loading: false,
loaded: false loaded: false,
pageKeyId: Object.freeze('userOrderRefundList')
}; };
}, },
methods: { methods: {
+4 -2
View File
@@ -125,9 +125,10 @@ import {
getUserPointInfo, getUserPointInfo,
getUserPointBill getUserPointBill
} from '@/api/user' } from '@/api/user'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'UserPoints', name: 'UserPoints',
props: {}, mixins: [pageListenMixins],
data: function() { data: function() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -145,7 +146,8 @@ export default {
totalUsedPoints: 0, // 累计使用积分 totalUsedPoints: 0, // 累计使用积分
pointsRule: '' pointsRule: ''
}, },
show: false show: false,
pageKeyId: Object.freeze('userPointsBill')
} }
}, },
created() { created() {
+4 -1
View File
@@ -251,8 +251,10 @@ import {
} from "@/api/user" } from "@/api/user"
import {isWeixin} from "@/utils" import {isWeixin} from "@/utils"
import cookie from "@/utils/store/cookie" import cookie from "@/utils/store/cookie"
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'UserPage', name: 'UserPage',
mixins: [pageListenMixins],
data() { data() {
return { return {
statusBarHeight: uni.getSystemInfoSync().statusBarHeight, statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
@@ -330,7 +332,8 @@ export default {
} }
], ],
bannerBgUrl: '', bannerBgUrl: '',
userCenterBannerUrl: '' userCenterBannerUrl: '',
pageKeyId: Object.freeze('userIndex')
} }
}, },
computed: mapGetters(['userInfo']), computed: mapGetters(['userInfo']),
+4 -2
View File
@@ -30,12 +30,13 @@
<script> <script>
import { getCommissionInfo } from "@/api/user"; import { getCommissionInfo } from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "UserBill", name: "UserBill",
components: { components: {
Loading Loading
}, },
props: {}, mixins: [pageListenMixins],
data: function() { data: function() {
return { return {
types: 0, types: 0,
@@ -45,7 +46,8 @@ export default {
}, },
list: [], list: [],
loaded: false, loaded: false,
loading: false loading: false,
pageKeyId: Object.freeze('userBalanceBill')
}; };
}, },
watch: { watch: {
+4 -2
View File
@@ -55,13 +55,14 @@ import attrs, {chs_extphone, required} from "@/utils/validate";
import {validatorDefaultCatch} from "@/utils/dialog"; import {validatorDefaultCatch} from "@/utils/dialog";
// import { openAddress } from "@/libs/wechat"; // import { openAddress } from "@/libs/wechat";
import {isWeixin} from "@/utils"; import {isWeixin} from "@/utils";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "AddAddress", name: "AddAddress",
components: { components: {
CitySelect CitySelect
}, },
computed: {}, mixins: [pageListenMixins],
data() { data() {
return { return {
district: [], district: [],
@@ -69,7 +70,8 @@ export default {
userAddress: {isDefault: 0}, userAddress: {isDefault: 0},
address: {}, address: {},
isWechat: isWeixin(), isWechat: isWeixin(),
addressText: "" addressText: "",
pageKeyId: Object.freeze('userAddressEdit')
}; };
}, },
mounted: function () { mounted: function () {
@@ -81,11 +81,13 @@
import {getAddressDefaultSet, getAddressList, getAddressRemove} from "@/api/user"; import {getAddressDefaultSet, getAddressList, getAddressRemove} from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import {isWeixin} from "@/utils"; import {isWeixin} from "@/utils";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: { components: {
Loading Loading
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -96,7 +98,8 @@ export default {
loadTitle: "", loadTitle: "",
loading: false, loading: false,
loadend: false, loadend: false,
isWechat: isWeixin() isWechat: isWeixin(),
pageKeyId: Object.freeze('userAddressIndex')
}; };
}, },
mounted: function () { mounted: function () {
@@ -41,13 +41,14 @@
<script> <script>
import { getCommissionInfo, getSpreadInfo } from "@/api/user"; import { getCommissionInfo, getSpreadInfo } from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "CommissionDetails", name: "CommissionDetails",
components: { components: {
Loading Loading
}, },
props: {}, mixins: [pageListenMixins],
data: function() { data: function() {
return { return {
info: [], info: [],
@@ -58,7 +59,8 @@ export default {
}, },
types: 9,//3, types: 9,//3,
loaded: false, loaded: false,
loading: false loading: false,
pageKeyId: Object.freeze('userSpreadBill')
}; };
}, },
mounted: function() { mounted: function() {
+4 -2
View File
@@ -126,13 +126,14 @@
<script> <script>
import {getSpreadUser} from "@/api/user"; import {getSpreadUser} from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "PromoterList", name: "PromoterList",
components: { components: {
Loading Loading
}, },
props: {}, mixins: [pageListenMixins],
data: function () { data: function () {
return { return {
fixedState: false, fixedState: false,
@@ -153,7 +154,8 @@ export default {
loadTitle: "", loadTitle: "",
first: "", first: "",
second: "", second: "",
webUrl: this.$VUE_APP_RESOURCES_URL webUrl: this.$VUE_APP_RESOURCES_URL,
pageKeyId: Object.freeze('userSpreadStat')
}; };
}, },
mounted: function () { mounted: function () {
+4 -2
View File
@@ -62,12 +62,13 @@
<script> <script>
import { getSpreadOrder, getUserSpreadRule } from "@/api/user"; import { getSpreadOrder, getUserSpreadRule } from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "PromoterOrder", name: "PromoterOrder",
components: { components: {
Loading Loading
}, },
props: {}, mixins: [pageListenMixins],
data: function() { data: function() {
return { return {
list: [], list: [],
@@ -79,7 +80,8 @@ export default {
loading: false, loading: false,
loadTitle: '', loadTitle: '',
count: '', count: '',
ruleText: '' ruleText: '',
pageKeyId: Object.freeze('userSpreadOrder')
} }
}, },
mounted() { mounted() {
+4 -3
View File
@@ -100,11 +100,11 @@
import { getSpreadInfo } from "@/api/user"; import { getSpreadInfo } from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "UserPromotion", name: "UserPromotion",
components: {}, mixins: [pageListenMixins],
props: {},
data: function() { data: function() {
return { return {
Info: { Info: {
@@ -112,7 +112,8 @@ export default {
extractCount: 0, extractCount: 0,
commissionCount: 0 commissionCount: 0
}, },
webUrl:this.$VUE_APP_RESOURCES_URL webUrl:this.$VUE_APP_RESOURCES_URL,
pageKeyId: Object.freeze('userSpreadIndex')
}; };
}, },
mounted: function() { mounted: function() {
+8 -5
View File
@@ -37,14 +37,17 @@
</template> </template>
<script> <script>
import {getLogs, takePrize} from "@/api/lottery"; import {getLogs, takePrize} from '@/api/lottery'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
loading: false, loading: false,
page: 1, page: 1,
list: [] list: [],
pageKeyId: Object.freeze('lotteryRecords')
} }
}, },
onShow() { onShow() {
@@ -98,15 +101,15 @@ export default {
confirmText: '查看订单', confirmText: '查看订单',
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
console.log('用户点击确定'); console.log('用户点击确定')
uni.navigateTo({ uni.navigateTo({
url: '/pages/order/MyOrder/index' url: '/pages/order/MyOrder/index'
}) })
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消'); console.log('用户点击取消')
} }
} }
}); })
} }
} }
} }
+4 -1
View File
@@ -82,9 +82,11 @@
<script> <script>
import { getDetail, getPrize, takePrize, getLotteryShareInfo } from '@/api/lottery' import { getDetail, getPrize, takePrize, getLotteryShareInfo } from '@/api/lottery'
import gbroMarquee from '../components/gbro-marquee/marquee.vue' import gbroMarquee from '../components/gbro-marquee/marquee.vue'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: { gbroMarquee }, components: { gbroMarquee },
mixins: [pageListenMixins],
data() { data() {
return { return {
ready: false, ready: false,
@@ -114,7 +116,8 @@ export default {
back_color: "red", //背景色 back_color: "red", //背景色
}, },
imgData: [], imgData: [],
shareAppImg: '' shareAppImg: '',
pageKeyId: Object.freeze('lotteryIndex')
} }
}, },
computed: { computed: {
+7 -3
View File
@@ -3,15 +3,19 @@
</template> </template>
<script> <script>
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "pdf", mixins: [pageListenMixins],
name: 'PdfView',
data() { data() {
return { return {
pdfPath: "" pdfPath: '',
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.pdfPath = options.path; this.pageKeyId = `investmentInfo_id_${options.id}`
this.pdfPath = options.path
} }
} }
</script> </script>
+9 -7
View File
@@ -17,24 +17,26 @@
</template> </template>
<script> <script>
import {getImages, getShopData} from "@/api/join"; import {getImages, getShopData} from '@/api/join'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "pkgJoinIndex", name: 'PkgJoinIndex',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
partnerId: "", partnerId: '',
partnerType: "", partnerType: '',
hotelId: null, hotelId: null,
hasHotel: null, hasHotel: null,
hasSupplier: null, hasSupplier: null,
hasWholesaler: null, hasWholesaler: null,
images: null images: null,
pageKeyId: Object.freeze('merchantApplyIndex')
} }
}, },
onLoad(options) { onLoad(options) {
this.partnerId = options.partnerId || ""; this.partnerId = options.partnerId || ''
getImages().then(({data}) => this.images = data); getImages().then(({data}) => this.images = data);
getShopData(this.partnerId).then(({data}) => { getShopData(this.partnerId).then(({data}) => {
this.partnerType = data.partnerType; this.partnerType = data.partnerType;
+4 -1
View File
@@ -310,6 +310,7 @@
<script> <script>
import CitySelect from "@/components/CitySelect" import CitySelect from "@/components/CitySelect"
import { pageListenMixins } from '@/mixins/pageListenMixins'
import { import {
getShopData, getShopData,
getShopInfo, getShopInfo,
@@ -332,6 +333,7 @@ export default {
components: { components: {
CitySelect CitySelect
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
partnerId: null, partnerId: null,
@@ -441,7 +443,8 @@ export default {
reviewStatus: null, reviewStatus: null,
stateTitle: '', stateTitle: '',
stateType: 'primary', stateType: 'primary',
isPass: false isPass: false,
pageKeyId: Object.freeze('merchantApplyHotel')
} }
}, },
onLoad(options) { onLoad(options) {
+16 -6
View File
@@ -430,12 +430,14 @@ import {
uploadImage, uploadImage,
chooseVideoToUpload chooseVideoToUpload
} from "@/utils" } from "@/utils"
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "pkgJoinSupplier", name: "PkgJoinSupplier",
components: { components: {
CitySelect CitySelect
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
partnerId: "", partnerId: "",
@@ -614,15 +616,23 @@ export default {
reviewStatus: null, reviewStatus: null,
stateTitle: "", stateTitle: "",
stateType: "primary", stateType: "primary",
isPass: false isPass: false,
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.partnerId = options.partnerId || ""; this.partnerId = options.partnerId || ''
this.formSupplier.subType = options.type; const type = options.type
this.infoTitle = options.type === "goods_supplier" ? "特产" : "文玩"; this.formSupplier.subType = type
if (type === 'goods_supplier') {
this.infoTitle = '特产'
this.pageKeyId = 'merchantApplyGoodsSupplier'
} else {
this.infoTitle = '文玩'
this.pageKeyId = 'merchantApplyWenwanSupplier'
}
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.infoTitle + "供应商入驻" title: this.infoTitle + '供应商入驻'
}) })
this.init(); this.init();
}, },
+4 -1
View File
@@ -156,12 +156,14 @@ import CitySelect from "@/components/CitySelect";
import {getShopData, getWholesaler, removeApply, saveWholesaler} from "@/api/join"; import {getShopData, getWholesaler, removeApply, saveWholesaler} from "@/api/join";
import {getCity, registerVerify} from "@/api/user"; import {getCity, registerVerify} from "@/api/user";
import {chooseImage} from "@/utils"; import {chooseImage} from "@/utils";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "pkgJoinWholesaler", name: "pkgJoinWholesaler",
components: { components: {
CitySelect CitySelect
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
tips: "", tips: "",
@@ -233,7 +235,8 @@ export default {
reviewStatus: null, reviewStatus: null,
stateTitle: "", stateTitle: "",
stateType: "primary", stateType: "primary",
isPass: false isPass: false,
pageKeyId: Object.freeze('merchantApplyWholesaler')
} }
}, },
onLoad(options) { onLoad(options) {
+19 -8
View File
@@ -16,7 +16,7 @@
<image class="title" :src="webUrl+'/20230220023931078168.png'" mode="scaleToFill"/> <image class="title" :src="webUrl+'/20230220023931078168.png'" mode="scaleToFill"/>
<view class="item flex" :style="{'backgroundImage':`url(${webUrl}/20230224102624521679.png)`}" <view class="item flex" :style="{'backgroundImage':`url(${webUrl}/20230224102624521679.png)`}"
v-for="(item,index) in products" :key="index" @click="$global.navToGoods(item.id)"> v-for="(item,index) in products" :key="index" @click="goGoods(item.id)">
<image class="cover flex-0" style="margin-right: 20rpx" :src="item.image" <image class="cover flex-0" style="margin-right: 20rpx" :src="item.image"
mode="scaleToFill" v-if="index%2===0"/> mode="scaleToFill" v-if="index%2===0"/>
@@ -42,24 +42,35 @@
</template> </template>
<script> <script>
import {getStoryDetail} from "@/api/product"; import {getStoryDetail} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "famousHot", name: 'FamousHot',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
products: [], products: [],
id: null, id: null,
story: null story: null,
pageKeyId: ''
} }
}, },
onLoad(option) { onLoad(option) {
this.id = option.id; const id = option.id
this.id = option.id
this.pageKeyId = `countyFamousContent_id_${id}`
getStoryDetail(this.id).then(({data}) => { getStoryDetail(this.id).then(({data}) => {
this.story = data; this.story = data
this.products = data.products; this.products = data.products
}) })
},
methods: {
goGoods(id) {
uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${id}&from=famous`
})
}
} }
} }
</script> </script>
+17 -14
View File
@@ -39,29 +39,32 @@
</template> </template>
<script> <script>
import {countyFamous} from "@/api/product"; import {countyFamous} from '@/api/product'
import {getProducts} from "@/api/store"; import {getProducts} from '@/api/store'
import {famousShareImage} from "@/api/share"; import {famousShareImage} from '@/api/share'
import {mapGetters} from "vuex"; import {mapGetters} from 'vuex'
import cookie from "@/utils/store/cookie"; import cookie from '@/utils/store/cookie'
import {userBindParent} from "@/api/user"; import {userBindParent} from '@/api/user'
import {getUrlParam} from "@/utils/common.js"; import {getUrlParam} from '@/utils/common.js'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "famousList", name: 'FamousList',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
keyword: "", keyword: '',
page: 1, page: 1,
bannerList: [], bannerList: [],
dataList: [], dataList: [],
navList: [], navList: [],
navIndex: 0, navIndex: 0,
partnerId: null partnerId: null,
pageKeyId: Object.freeze('countyFamousIndex')
} }
}, },
computed: mapGetters(["userInfo", "isLogin"]), computed: mapGetters(['userInfo', 'isLogin']),
onShareAppMessage() { onShareAppMessage() {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
const {status, data} = await famousShareImage(); const {status, data} = await famousShareImage();
@@ -81,11 +84,11 @@ export default {
let obj = uni.getEnterOptionsSync(); let obj = uni.getEnterOptionsSync();
if (options.scene != null || obj.query.scene != null) { if (options.scene != null || obj.query.scene != null) {
let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene); let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene);
this.partnerId = getUrlParam(query, "partnerId") || null; this.partnerId = getUrlParam(query, 'partnerId') || null;
} }
} }
if (this.partnerId) { if (this.partnerId) {
cookie.set("spread", this.partnerId); cookie.set('spread', this.partnerId);
userBindParent({spread: parseInt(this.partnerId)}); userBindParent({spread: parseInt(this.partnerId)});
} }
@@ -132,7 +135,7 @@ export default {
}, },
goStory() { goStory() {
uni.navigateTo({ uni.navigateTo({
url: "/pkg_product/views/famousStory" url: '/pkg_product/views/famousStory'
}) })
} }
} }
+10 -7
View File
@@ -6,39 +6,42 @@
<script> <script>
import {getStoryList} from "@/api/product"; import {getStoryList} from "@/api/product";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "famousStory", name: "famousStory",
mixins: [pageListenMixins],
data() { data() {
return { return {
page: 1, // 当前页 page: 1, // 当前页
pages: 1, // 总页数 pages: 1, // 总页数
list: [] list: [],
pageKeyId: Object.freeze('countyFamousContentList')
} }
}, },
onLoad() { onLoad() {
this.fetchData(); this.fetchData()
}, },
onReachBottom() { onReachBottom() {
if (this.page < this.pages) { if (this.page < this.pages) {
this.page++; this.page++
this.fetchData(); this.fetchData()
} }
}, },
methods: { methods: {
fetchData() { fetchData() {
getStoryList(this.page).then(({data}) => { getStoryList(this.page).then(({data}) => {
this.pages = data.pages; this.pages = data.pages
if (data.records.length > 0) { if (data.records.length > 0) {
for (let i = 0; i < data.records.length; i++) { for (let i = 0; i < data.records.length; i++) {
this.list.push(data.records[i]); this.list.push(data.records[i])
} }
} }
}) })
}, },
goHot(item) { goHot(item) {
uni.navigateTo({ uni.navigateTo({
url: "/pkg_product/views/famousHot?id=" + item.id url: '/pkg_product/views/famousHot?id=' + item.id
}) })
} }
} }
+13 -3
View File
@@ -35,7 +35,7 @@
:class="cIndex === 0 ? 'span12' : 'span8'" :class="cIndex === 0 ? 'span12' : 'span8'"
:src="item.image" :src="item.image"
mode="scaleToFill" mode="scaleToFill"
@click="$global.navToGoods(item.id)" @click="goGoods(item.id)"
/> />
</view> </view>
</view> </view>
@@ -46,13 +46,16 @@
<script> <script>
// 节日专题 // 节日专题
import { getFestival } from '@/api/product' import { getFestival } from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'Festival', name: 'FestivalPage',
mixins: [pageListenMixins],
data() { data() {
return { return {
isLoad: false, isLoad: false,
topImage: '', topImage: '',
contents: [] contents: [],
pageKeyId: Object.freeze('appContentFestival')
} }
}, },
onLoad() { onLoad() {
@@ -61,6 +64,13 @@ export default {
this.topImage = data.topImage this.topImage = data.topImage
this.contents = data.contents this.contents = data.contents
}) })
},
methods: {
goGoods(id) {
uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${id}&from=festival`
})
}
} }
} }
</script> </script>
+7 -2
View File
@@ -43,8 +43,10 @@
import { import {
customizedGiftContent customizedGiftContent
} from '@/api/product' } from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'GiftContent', name: 'GiftContent',
mixins: [pageListenMixins],
data() { data() {
return { return {
data: { data: {
@@ -55,6 +57,7 @@ export default {
mainImage: '', mainImage: '',
productList1: [], productList1: [],
productList2: [], productList2: [],
pageKeyId: ''
} }
} }
}, },
@@ -62,7 +65,9 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: options.name + '-' + '特色礼品' title: options.name + '-' + '特色礼品'
}) })
this.getPageDataReq(options.id) const id = options.id
this.pageKeyId = `customizedGiftContent_id_${id}`
this.getPageDataReq(id)
}, },
methods: { methods: {
getPageDataReq(id) { getPageDataReq(id) {
@@ -90,7 +95,7 @@ export default {
return return
} }
uni.navigateTo({ uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${productId}` url: `/pages/shop/GoodsCon/index?id=${productId}&from=gift`
}) })
} }
} }
+5 -2
View File
@@ -90,14 +90,17 @@
import { import {
customizedGift customizedGift
} from '@/api/product' } from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'GiftList', name: 'GiftList',
mixins: [pageListenMixins],
data() { data() {
return { return {
provinceList: [], provinceList: [],
topBannerHtml: '', topBannerHtml: '',
topBannerUrl: '', topBannerUrl: '',
toggleStatus: false toggleStatus: false,
pageKeyId: Object.freeze('customizedGiftIndex')
} }
}, },
onLoad() { onLoad() {
@@ -148,7 +151,7 @@ export default {
return return
} }
uni.navigateTo({ uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${productId}` url: `/pages/shop/GoodsCon/index?id=${productId}&from=gift`
}) })
}, },
toggleHandle(value) { toggleHandle(value) {
+10 -12
View File
@@ -1,23 +1,26 @@
<script> <script>
import {getICH} from "@/api/product"; import {getICH} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "heritage", name: 'HeritagePage',
mixins: [pageListenMixins],
data() { data() {
return { return {
contents: [], contents: [],
topImage: '', topImage: '',
backgroundImage: '', backgroundImage: '',
bgImgWidth: 0, bgImgWidth: 0,
pageKeyId: Object.freeze('ichIndex')
} }
}, },
computed: { computed: {
scale() { scale() {
return 750 / this.bgImgWidth; return 750 / this.bgImgWidth
} }
}, },
onLoad() { onLoad() {
this.init(); this.init()
}, },
methods: { methods: {
init() { init() {
@@ -29,17 +32,15 @@ export default {
this.calcPosition(); this.calcPosition();
}) })
}, },
// 计算位置 // 计算位置
calcPosition() { calcPosition() {
this.contents?.forEach(item => { this.contents?.forEach(item => {
item.gx = item.x * this.scale; item.gx = item.x * this.scale
item.gy = item.y * this.scale; item.gy = item.y * this.scale
}) })
}, },
goDetails(item) { goDetails(item) {
if (!item.isLink) return; if (!item.isLink) return
if (item.type === 1) { if (item.type === 1) {
uni.navigateTo({ uni.navigateTo({
url: '/pkg_product/views/heritageVideo?id=' + item.id url: '/pkg_product/views/heritageVideo?id=' + item.id
@@ -57,16 +58,13 @@ export default {
<template> <template>
<view class="pkg-product-heritage"> <view class="pkg-product-heritage">
<image style="width: 100%" :src="topImage" mode="widthFix"/> <image style="width: 100%" :src="topImage" mode="widthFix"/>
<view class="main-box"> <view class="main-box">
<image style="width: 100%" :src="backgroundImage" mode="widthFix"/> <image style="width: 100%" :src="backgroundImage" mode="widthFix"/>
<view class="item" :style="{'left':item.gx+'rpx','top':item.gy+'rpx'}" v-for="(item,index) in contents" <view class="item" :style="{'left':item.gx+'rpx','top':item.gy+'rpx'}" v-for="(item,index) in contents"
:key="index" @click="goDetails(item)"> :key="index" @click="goDetails(item)">
<image class="img-item" :src="item.image"/> <image class="img-item" :src="item.image"/>
<view class="title flex jc-center">{{ item.title }}</view> <view class="title flex jc-center">{{ item.title }}</view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
+10 -7
View File
@@ -1,28 +1,32 @@
<script> <script>
import {getICHDetails} from "@/api/product"; import {getICHDetails} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "heritageGoods", name: 'HeritageGoods',
mixins: [pageListenMixins],
data() { data() {
return { return {
id: null, id: null,
info: null, info: null,
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.id = options.id; const id = options.id
this.id = id
this.pageKeyId = `ichContent_id_${id}`
this.getDetails(); this.getDetails();
}, },
methods: { methods: {
getDetails() { getDetails() {
getICHDetails(this.id).then(({data}) => this.info = data); getICHDetails(this.id).then(({data}) => this.info = data);
}, },
goGoods(id) { goGoods(id) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/shop/GoodsCon/index?id=" + id url: '/pages/shop/GoodsCon/index?id=' + id + '&from=ich'
}) })
}, }
} }
} }
</script> </script>
@@ -30,7 +34,6 @@ export default {
<template> <template>
<view class="heritage-goods" v-if="info"> <view class="heritage-goods" v-if="info">
<image class="page-bg" :src="info.backgroundImage" mode="widthFix"/> <image class="page-bg" :src="info.backgroundImage" mode="widthFix"/>
<view class="list-box flex flex-wrap"> <view class="list-box flex flex-wrap">
<view class="item flex flex-col jc-between" v-for="(item,index) in info.products" :key="index" <view class="item flex flex-col jc-between" v-for="(item,index) in info.products" :key="index"
@click="goGoods(item.productId)"> @click="goGoods(item.productId)">
+10 -9
View File
@@ -1,21 +1,25 @@
<script> <script>
import {getICHDetails} from "@/api/product"; import {getICHDetails} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "heritageVideo", name: 'HeritageVideo',
mixins: [pageListenMixins],
data() { data() {
return { return {
id: null, id: null,
info: null, info: null,
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.id = options.id; const id = options.id
this.getDetails(); this.id = id
this.pageKeyId = `ichContent_id_${id}`
this.getDetails()
}, },
methods: { methods: {
getDetails() { getDetails() {
getICHDetails(this.id).then(({data}) => this.info = data); getICHDetails(this.id).then(({data}) => this.info = data)
} }
} }
} }
@@ -25,9 +29,6 @@ export default {
<view class="heritage-video" v-if="info"> <view class="heritage-video" v-if="info">
<image class="page-bg" :src="info.backgroundImage" mode="widthFix"/> <image class="page-bg" :src="info.backgroundImage" mode="widthFix"/>
<video :src="info.video" autoplay show-center-play-btn/> <video :src="info.video" autoplay show-center-play-btn/>
<!-- <video id="myVideo" src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4"-->
<!-- autoplay controls></video>-->
</view> </view>
</template> </template>
+14 -10
View File
@@ -1,30 +1,34 @@
<script> <script>
import {getHomestay} from "@/api/product"; // 民宿专题
import {getHomestay} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "homestay", // 民宿专题 name: 'HomestayPage',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
topImage: '', topImage: '',
contents: [], contents: [],
id: null id: null,
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.id = options.id; const id = options.id
this.id = id
this.pageKeyId = `appContentHomestay_id_${id}`
getHomestay(this.id).then(({data}) => { getHomestay(this.id).then(({data}) => {
this.topImage = data.topImage; this.topImage = data.topImage
this.contents = data.contents; this.contents = data.contents
}) })
}, },
methods: { methods: {
goInnDetail(item) { goInnDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pagesInn/inn/innHome?id=${item.id}` url: `/pagesInn/inn/innHome?id=${item.id}&from=homestay`
}) })
}, }
} }
} }
</script> </script>
+20 -10
View File
@@ -1,9 +1,11 @@
<script> <script>
import {getSeason, getSeasonPoster} from "@/api/product"; import {getSeason, getSeasonPoster} from '@/api/product'
import cookie from "@/utils/store/cookie"; import cookie from '@/utils/store/cookie'
import {getUrlParam} from "@/utils/common.js"; import {getUrlParam} from '@/utils/common.js'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -12,15 +14,18 @@ export default {
info: null, info: null,
current: 0, current: 0,
showShare: false, showShare: false,
posterUrl: "", // 分享海报 posterUrl: '', // 分享海报
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
if (options.id) { const id = options.id
this.id = options.id || null; if (id) {
this.partnerId = options.partnerId || null; this.id = id || null
this.pageKeyId = `seasonalFoodContent_id_${id}`
this.partnerId = options.partnerId || null
} else { } else {
let obj = uni.getEnterOptionsSync(); const obj = uni.getEnterOptionsSync()
if (options.scene || obj.query.scene) { if (options.scene || obj.query.scene) {
let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene); let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene);
this.id = getUrlParam(query, "id") || null; this.id = getUrlParam(query, "id") || null;
@@ -131,7 +136,12 @@ export default {
} }
}) })
}, },
}, goGoods(id) {
uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${id}&from=season`
})
}
}
} }
</script> </script>
@@ -168,7 +178,7 @@ export default {
<image class="bg-img" :src="info.productImage" mode="widthFix"/> <image class="bg-img" :src="info.productImage" mode="widthFix"/>
<!-- <scroll-view scroll-y class="product-list" :style="{backgroundImage:'url(' + info.productImage + ')'}">--> <!-- <scroll-view scroll-y class="product-list" :style="{backgroundImage:'url(' + info.productImage + ')'}">-->
<scroll-view scroll-y class="product-list"> <scroll-view scroll-y class="product-list">
<image class="item" :src="item.image" mode="widthFix" @click="$global.navToGoods(item.id)" <image class="item" :src="item.image" mode="widthFix" @click="goGoods(item.id)"
v-for="(item,index) in info.products" :key="index"/> v-for="(item,index) in info.products" :key="index"/>
</scroll-view> </scroll-view>
</view> </view>
+9 -6
View File
@@ -1,31 +1,34 @@
<script> <script>
import {seasonHomeData} from "@/api/product"; import {seasonHomeData} from '@/api/product'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
typeList: ["时令果蔬", "水产海鲜", "肉禽蛋白", "全部分类"], typeList: ['时令果蔬', '水产海鲜', '肉禽蛋白', '全部分类'],
list: [], list: [],
typeIndex: 0 typeIndex: 0,
pageKeyId: Object.freeze('seasonalFoodIndex')
} }
}, },
onLoad() { onLoad() {
this.init(); this.init()
}, },
methods: { methods: {
changeType(index){ changeType(index){
this.typeIndex=index this.typeIndex=index
}, },
init() { init() {
seasonHomeData().then(({data}) => this.list = data.seasonalFoodType || []); seasonHomeData().then(({data}) => this.list = data.seasonalFoodType || [])
}, },
goDetail() { goDetail() {
uni.navigateTo({ uni.navigateTo({
url: "/pkg_product/views/season?id=" + this.list[this.typeIndex].contents[0].id url: "/pkg_product/views/season?id=" + this.list[this.typeIndex].contents[0].id
}) })
} }
}, }
} }
</script> </script>
+48 -59
View File
@@ -156,26 +156,27 @@
</template> </template>
<script> <script>
import CountDownUnit from "@/pkg_product/components/CountDownUnit.vue"; import CountDownUnit from '@/pkg_product/components/CountDownUnit.vue'
import {getSeckillRule, getSeckillTopList, getYxStoreSeckillIndex, getYxStoreSeckillPageList} from "@/api/goods"; import {getSeckillRule, getSeckillTopList, getYxStoreSeckillIndex, getYxStoreSeckillPageList} from '@/api/goods'
import {secKillShareImage} from "@/api/share"; import {secKillShareImage} from '@/api/share'
import {mapGetters} from "vuex"; import {mapGetters} from 'vuex'
import cookie from "@/utils/store/cookie"; import cookie from '@/utils/store/cookie'
import {userBindParent} from "@/api/user"; import {userBindParent} from '@/api/user'
import {getUrlParam} from "@/utils/common.js"; import {getUrlParam} from '@/utils/common.js'
import NoGoodData from '@/components/good/NoData' import NoGoodData from '@/components/good/NoData'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "seckill", name: 'Seckill',
components: { components: {
CountDownUnit, CountDownUnit,
NoGoodData NoGoodData
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
showRule: false, showRule: false,
seckillTime: [], seckillTime: [],
seckillTimeIndex: 0, seckillTimeIndex: 0,
page: 1, page: 1,
@@ -185,13 +186,14 @@ export default {
timeId: null, timeId: null,
nextList: [], nextList: [],
ruleContent: null, ruleContent: null,
partnerId: null partnerId: null,
pageKeyId: Object.freeze('seckillIndex')
} }
}, },
computed: mapGetters(["userInfo", "isLogin"]), computed: mapGetters(['userInfo', 'isLogin']),
onShareAppMessage() { onShareAppMessage() {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
const {status, data} = await secKillShareImage(); const {status, data} = await secKillShareImage()
if (status === 200) { if (status === 200) {
resolve({ resolve({
title: '探寻有趣有味的生活方式', title: '探寻有趣有味的生活方式',
@@ -203,91 +205,78 @@ export default {
}, },
onLoad(options) { onLoad(options) {
if (options.partnerId) { if (options.partnerId) {
this.partnerId = options.partnerId || null; this.partnerId = options.partnerId || null
} else { } else {
let obj = uni.getEnterOptionsSync(); let obj = uni.getEnterOptionsSync()
if (options.scene != null || obj.query.scene != null) { if (options.scene != null || obj.query.scene != null) {
let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene); let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene)
this.partnerId = getUrlParam(query, "partnerId") || null; this.partnerId = getUrlParam(query, 'partnerId') || null
} }
} }
if (this.partnerId) { if (this.partnerId) {
cookie.set("spread", this.partnerId); cookie.set('spread', this.partnerId)
userBindParent({spread: parseInt(this.partnerId)}); userBindParent({spread: parseInt(this.partnerId)})
} }
this.fetchSession()
this.fetchSession(); getSeckillRule().then(({data}) => this.ruleContent = data)
getSeckillRule().then(({data}) => this.ruleContent = data); getSeckillTopList(1, 10).then(({data}) => this.topList = data.records)
getSeckillTopList(1, 10).then(({data}) => this.topList = data.records);
}, },
onReachBottom() { onReachBottom() {
if (this.endReach) return; if (this.endReach) return
this.page++; this.page++
this.fetchList(); this.fetchList()
}, },
methods: { methods: {
changeRule(){ changeRule(){
this.showRule=!this.showRule this.showRule=!this.showRule
}, },
navChange(index) { navChange(index) {
if (this.seckillTimeIndex === index) return; if (this.seckillTimeIndex === index) return
this.seckillTimeIndex = index; this.seckillTimeIndex = index
this.page = 1; this.page = 1
this.list = []; this.list = []
this.timeId = this.seckillTime[this.seckillTimeIndex].id; this.timeId = this.seckillTime[this.seckillTimeIndex].id
this.endReach = false; this.endReach = false
this.fetchList() this.fetchList()
}, },
fetchSession() { fetchSession() {
getYxStoreSeckillIndex().then(({ getYxStoreSeckillIndex().then(({ data }) => {
data if (data.seckillTime.length === 0) return
}) => { this.seckillTime = data.seckillTime.filter(item => item.status > 0)
if (data.seckillTime.length === 0) return; this.timeId = this.seckillTime[this.seckillTimeIndex].id
this.fetchList()
this.seckillTime = data.seckillTime.filter(item => item.status > 0);
this.timeId = this.seckillTime[this.seckillTimeIndex].id;
this.fetchList();
if (this.seckillTime.length > this.seckillTimeIndex) { if (this.seckillTime.length > this.seckillTimeIndex) {
getYxStoreSeckillPageList(1, 10, this.seckillTime[this.seckillTimeIndex + 1].id).then(({ getYxStoreSeckillPageList(1, 10, this.seckillTime[this.seckillTimeIndex + 1].id).then(({ data }) => {
data this.nextList = data
}) => {
this.nextList = data;
}) })
} }
}); })
}, },
fetchList() { fetchList() {
getYxStoreSeckillPageList(this.page, 10, this.timeId).then(({ getYxStoreSeckillPageList(this.page, 10, this.timeId).then(({ data }) => {
data
}) => {
if (data.length > 0) { if (data.length > 0) {
data.map(item => this.list.push(item)); data.map(item => this.list.push(item));
} else { } else {
this.endReach = true; this.endReach = true
} }
}); })
}, },
goGoodsConByProductID(item, status) { goGoodsConByProductID(item, status) {
if (status > 1) { if (status > 1) {
uni.showToast({ uni.showToast({
title: "此商品秒杀活动还未开始哦", title: '此商品秒杀活动还未开始哦',
icon: "none" icon: 'none'
}) })
return; return
} }
this.$yrouter.push({ this.$yrouter.push({
path: '/pages/shop/GoodsCon/index', path: '/pages/shop/GoodsCon/index',
query: { query: {
id: item.productId, id: item.productId,
activityId: item.id, activityId: item.id,
from: "kill" from: 'kill'
} }
}); })
} }
} }
} }
+4 -2
View File
@@ -47,9 +47,10 @@
<script> <script>
import {bankList, addBankCard} from "@/api/user"; import {bankList, addBankCard} from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: {}, mixins: [pageListenMixins],
data: function () { data: function () {
return { return {
name: "", name: "",
@@ -59,7 +60,8 @@ export default {
bankList: [], bankList: [],
banks: [], banks: [],
index: 0, index: 0,
showPicker: false showPicker: false,
pageKeyId: Object.freeze('userBankCardEdit')
}; };
}, },
watch: {}, watch: {},
+4 -1
View File
@@ -56,8 +56,10 @@
import MescrollMixins from "@/mixins/mescroll-mixins.js"; import MescrollMixins from "@/mixins/mescroll-mixins.js";
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"; import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue";
import {getBank, postCashInfo, bankCardList, deleteBankCard} from "@/api/user"; import {getBank, postCashInfo, bankCardList, deleteBankCard} from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
list: [], list: [],
@@ -77,7 +79,8 @@ export default {
}, },
isSelectMode: false, isSelectMode: false,
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
bgColor: ["#FD574B", "#0DC5C5", "#3F57DA", "#FF4F48"] bgColor: ["#FD574B", "#0DC5C5", "#3F57DA", "#FF4F48"],
pageKeyId: Object.freeze('userBankCardIndex')
} }
}, },
components: { components: {
+4 -3
View File
@@ -25,16 +25,17 @@ import sendVerifyCode from "@/mixins/SendVerifyCode";
import {required, alpha_num, chs_phone} from "@/utils/validate"; import {required, alpha_num, chs_phone} from "@/utils/validate";
import {validatorDefaultCatch} from "@/utils/dialog"; import {validatorDefaultCatch} from "@/utils/dialog";
import {registerVerify, bindingPhoneByInput} from "@/api/user"; import {registerVerify, bindingPhoneByInput} from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "BindingPhone", name: "BindingPhone",
components: {}, mixins: [pageListenMixins],
props: {},
data: function () { data: function () {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
captcha: "", captcha: "",
phone: "" //手机号 phone: "",
pageKeyId: Object.freeze('userConfigPhone')
}; };
}, },
mixins: [sendVerifyCode], mixins: [sendVerifyCode],
+4 -1
View File
@@ -12,17 +12,20 @@
import SubSection from '@/components/SubSection.vue' import SubSection from '@/components/SubSection.vue'
import Coupons from '../components/Coupons.vue' import Coupons from '../components/Coupons.vue'
import {getCouponsUser} from '@/api/user' import {getCouponsUser} from '@/api/user'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "myCoupons", name: "myCoupons",
components: {SubSection, Coupons}, components: {SubSection, Coupons},
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
current: 0, current: 0,
canUse: 0, canUse: 0,
notUse: 0, notUse: 0,
list: [] list: [],
pageKeyId: Object.freeze('userCouponsIndex')
} }
}, },
onLoad() { onLoad() {
+3
View File
@@ -126,9 +126,11 @@
import {getProductList, getStoreList, getVideoList, removeFavorite} from "@/api/favorite"; import {getProductList, getStoreList, getVideoList, removeFavorite} from "@/api/favorite";
import {postCartAdd} from "@/api/store"; import {postCartAdd} from "@/api/store";
import CheckboxIcon from "@/components/CheckboxIcon.vue"; import CheckboxIcon from "@/components/CheckboxIcon.vue";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: {CheckboxIcon}, components: {CheckboxIcon},
mixins: [pageListenMixins],
data() { data() {
return { return {
ready: false, ready: false,
@@ -145,6 +147,7 @@ export default {
productList: [], productList: [],
storeList: [], storeList: [],
videoList: [], videoList: [],
pageKeyId: Object.freeze('userCollectionIndex')
} }
}, },
computed: { computed: {
+4 -1
View File
@@ -45,14 +45,17 @@ import sendVerifyCode from "@/mixins/SendVerifyCode";
import { required, alpha_num, chs_phone } from "@/utils/validate"; import { required, alpha_num, chs_phone } from "@/utils/validate";
import { validatorDefaultCatch } from "@/utils/dialog"; import { validatorDefaultCatch } from "@/utils/dialog";
import { getUserInfo, registerVerify, bindingPhone,modifyUserPayPwd } from "@/api/user"; import { getUserInfo, registerVerify, bindingPhone,modifyUserPayPwd } from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
captcha: "", captcha: "",
phone:'', phone:'',
payPwd:'' payPwd:'',
pageKeyId: Object.freeze('userConfigPasswordPay')
} }
}, },
mixins: [sendVerifyCode], mixins: [sendVerifyCode],
+3
View File
@@ -76,12 +76,14 @@ import {mapGetters} from "vuex";
import {isWeixin, trim, uploadImage} from "@/utils"; import {isWeixin, trim, uploadImage} from "@/utils";
import {postUserEdit} from "@/api/user"; import {postUserEdit} from "@/api/user";
import ImageCropper from "@/pkg_user/components/invinbg-image-cropper/invinbg-image-cropper.vue"; import ImageCropper from "@/pkg_user/components/invinbg-image-cropper/invinbg-image-cropper.vue";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "PersonalData", name: "PersonalData",
components: { components: {
ImageCropper ImageCropper
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -92,6 +94,7 @@ export default {
userIndex: 0, userIndex: 0,
tempFilePath: '', tempFilePath: '',
cropFilePath: '', cropFilePath: '',
pageKeyId: Object.freeze('userConfig')
}; };
}, },
computed: mapGetters(["userInfo"]), computed: mapGetters(["userInfo"]),
+4 -1
View File
@@ -79,8 +79,10 @@ import { getBank, bankCardList, postCashInfo } from "@/api/user";
import NP from "number-precision"; import NP from "number-precision";
import uniPopup from '@/components/uni-popup/uni-popup.vue'; import uniPopup from '@/components/uni-popup/uni-popup.vue';
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue'; import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue';
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -94,7 +96,8 @@ export default {
gdAmount: 0, //固定手续费 gdAmount: 0, //固定手续费
gdLimit: 0, //最低固定费率额度 gdLimit: 0, //最低固定费率额度
feeRate: 0, //手续费费率 feeRate: 0, //手续费费率
remark: "" //提现说明 remark: "", //提现说明
pageKeyId: Object.freeze('userExtractIndex')
} }
}, },
components: { components: {
+3
View File
@@ -33,14 +33,17 @@
<script> <script>
import {payoutLog} from "@/api/user"; import {payoutLog} from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
ready: false, ready: false,
list: [], list: [],
page: 1, page: 1,
pageKeyId: Object.freeze('userExtractRecords')
} }
}, },
mounted() { mounted() {
+4 -1
View File
@@ -57,11 +57,13 @@ import {getAttract, investment, saveAttract} from "@/api/shop.js";
// import { // import {
// queryByType // queryByType
// } from "@/api/public"; // } from "@/api/public";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: { components: {
CitySelect CitySelect
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -80,7 +82,8 @@ export default {
investmentTopImage: null, investmentTopImage: null,
investmentMainImage: null, investmentMainImage: null,
investmentBottomImage: null, investmentBottomImage: null,
investmentTitle: "" investmentTitle: "",
pageKeyId: Object.freeze('investmentIndex')
} }
}, },
onLoad: function () { onLoad: function () {
+13 -10
View File
@@ -22,32 +22,35 @@
</template> </template>
<script> <script>
import {investmentInfo} from "@/api/shop"; import {investmentInfo} from '@/api/shop'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "project", name: 'ProjectDetail',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
id: null, id: null,
info: null info: null,
pageKeyId: ''
} }
}, },
onLoad(option) { onLoad(option) {
this.id = option.id; const id = option.id
this.init(); this.id = id
this.pageKeyId = `investmentInfo_id_${id}`
this.init()
}, },
methods: { methods: {
init() { init() {
investmentInfo(this.id).then(({data}) => this.info = data); investmentInfo(this.id).then(({data}) => this.info = data)
}, },
viewFile(item) { viewFile(item) {
if (item.suffix === "pdf") { if (item.suffix === 'pdf') {
uni.downloadFile({ uni.downloadFile({
url: item.attachment, url: item.attachment,
success: res => { success: res => {
let filePath = res.tempFilePath; const filePath = res.tempFilePath
uni.openDocument({ uni.openDocument({
filePath filePath
}) })
+23 -24
View File
@@ -20,26 +20,29 @@
</template> </template>
<script> <script>
import {investmentInfo, investmentList} from "@/api/shop"; import {investmentInfo, investmentList} from '@/api/shop'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "projectList", name: 'ProjectList',
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
page: 1, // 当前页 page: 1, // 当前页
keyword: "", // 搜索词 keyword: '', // 搜索词
pages: 0, // 总页数 pages: 0, // 总页数
list: [], list: [],
os: "" os: '',
pageKeyId: Object.freeze('investmentList')
} }
}, },
mounted() { mounted() {
this.getOS(); this.getOS()
this.getData(); this.getData()
}, },
onReachBottom() { onReachBottom() {
if (this.pages >= this.page) this.getData(); if (this.pages >= this.page) this.getData()
}, },
methods: { methods: {
getOS() { getOS() {
@@ -47,39 +50,35 @@ export default {
success: result => this.os = result.osName success: result => this.os = result.osName
}) })
}, },
search() { search() {
this.list = []; this.list = []
this.page = 1; this.page = 1
this.getData(); this.getData()
}, },
getData() { getData() {
investmentList(this.page, this.keyword).then(({data}) => { investmentList(this.page, this.keyword).then(({data}) => {
this.pages = data.pages; this.pages = data.pages
this.page++; this.page++
if (data.records.length > 0) { if (data.records.length > 0) {
data.records.map(item => { data.records.map(item => {
this.list.push(item); this.list.push(item)
}) })
} }
}); })
}, },
getDetail(id) { getDetail(id) {
investmentInfo(id).then(({data}) => { investmentInfo(id).then(({data}) => {
const file = data.contents[0]; const file = data.contents[0];
if (file.suffix === "pdf" && this.os === "android") { if (file.suffix === 'pdf' && this.os === 'android') {
this.viewPdf(file.attachmentFiles[0]) this.viewPdf(file.attachmentFiles[0])
} else { } else {
let path = file.attachmentFiles[0]; let path = file.attachmentFiles[0];
uni.navigateTo({ uni.navigateTo({
url: "/pkg_common/views/pdf?path=" + encodeURI(path) url: '/pkg_common/views/pdf?path=' + encodeURI(path) + '&id=' + id
}) })
} }
}); })
}, },
viewPdf(url) { viewPdf(url) {
uni.downloadFile({ uni.downloadFile({
url,//可以是后台传过来的路径 url,//可以是后台传过来的路径
@@ -87,13 +86,13 @@ export default {
const filePath = res.tempFilePath const filePath = res.tempFilePath
uni.openDocument({ uni.openDocument({
filePath, filePath,
fileType: "pdf", fileType: 'pdf',
success: result => { success: result => {
//成功 //成功
}, },
fail: err => { fail: err => {
uni.showModal({ uni.showModal({
title: "openDocument fail", title: 'openDocument fail',
content: JSON.stringify(err) content: JSON.stringify(err)
}) })
} }
@@ -101,7 +100,7 @@ export default {
}, },
fail: err => { fail: err => {
uni.showModal({ uni.showModal({
title: "downloadFile fail", title: 'downloadFile fail',
content: JSON.stringify(err) content: JSON.stringify(err)
}) })
} }