|
@@ -1,132 +0,0 @@
|
|
-<template>
|
|
|
|
- <mobile-frame>
|
|
|
|
- <view class="main">
|
|
|
|
- <view class="one">
|
|
|
|
- <scroll-view scroll-y="true" class="scroll-view">
|
|
|
|
- <view class="list-scroll-view">
|
|
|
|
- <view class="one_1">
|
|
|
|
- 第一部分
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </scroll-view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </mobile-frame>
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script>
|
|
|
|
- export default {
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- // 商品id
|
|
|
|
- id: '',
|
|
|
|
- // 分享人id
|
|
|
|
- inviter: '',
|
|
|
|
- // 系统设置
|
|
|
|
- config: {},
|
|
|
|
- // 系统菜单
|
|
|
|
- barList: [],
|
|
|
|
- // 当前用户信息
|
|
|
|
- user: {},
|
|
|
|
- // 是否关注商品
|
|
|
|
- goodsColect: false,
|
|
|
|
- // 是否关注店铺
|
|
|
|
- shopColect: false,
|
|
|
|
- // 评价数
|
|
|
|
- evaluate_num: 2,
|
|
|
|
- // 商品详情
|
|
|
|
- info: {},
|
|
|
|
- infospecs: {},
|
|
|
|
- // 优惠
|
|
|
|
- discount: {},
|
|
|
|
- };
|
|
|
|
- },
|
|
|
|
- onLoad: async function(e) {
|
|
|
|
- const that = this;
|
|
|
|
- that.$set(that, `id`, e.id || '');
|
|
|
|
- that.$set(that, `inviter`, e.inviter || '');
|
|
|
|
- // 系统设置
|
|
|
|
- await that.searchConfig();
|
|
|
|
- // 数据查询
|
|
|
|
- await that.search();
|
|
|
|
- // 配置分享内容
|
|
|
|
- await that.configShare();
|
|
|
|
- },
|
|
|
|
- onShow: function() {
|
|
|
|
- const that = this;
|
|
|
|
- // 当前用户信息
|
|
|
|
- that.watchLogin();
|
|
|
|
- },
|
|
|
|
- onUnload: function() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- // 查询系统设置
|
|
|
|
- searchConfig() {
|
|
|
|
- const that = this;
|
|
|
|
- uni.getStorage({
|
|
|
|
- key: 'config',
|
|
|
|
- success: function(res) {
|
|
|
|
- let data = res.data;
|
|
|
|
- that.$set(that, `config`, data);
|
|
|
|
- if (data.bottom_menu && data.bottom_menu.list.length > 0) {
|
|
|
|
- let list = data.bottom_menu.list.sort((a, b) => {
|
|
|
|
- return a.sort - b.sort
|
|
|
|
- });
|
|
|
|
- that.$set(that, `barList`, list)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 查询用户信息
|
|
|
|
- watchLogin() {
|
|
|
|
- const that = this;
|
|
|
|
- uni.getStorage({
|
|
|
|
- key: 'token',
|
|
|
|
- success: function(res) {
|
|
|
|
- let user = that.$jwt(res.data);
|
|
|
|
- if (user) that.$set(that, `user`, user);
|
|
|
|
- },
|
|
|
|
- fail: function(err) {
|
|
|
|
- console.log('暂无用户信息');
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 配置分享内容
|
|
|
|
- configShare() {
|
|
|
|
- const that = this;
|
|
|
|
- let id = that.id;
|
|
|
|
- let inviter = that.user && that.user._id ? that.user._id : '';
|
|
|
|
- let title = that.info && that.info.goods ? that.info.goods.name : '';
|
|
|
|
- let imageUrl = that.info && that.info.goods ? that.info.goods.file[0].url : '';
|
|
|
|
- that.$config.share = {
|
|
|
|
- title: title,
|
|
|
|
- path: `/pagesHome/order/detail?id=${id}&inviter=${inviter}`,
|
|
|
|
- imageUrl: imageUrl
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- async search() {
|
|
|
|
- const that = this;
|
|
|
|
- let id = that.id;
|
|
|
|
- if (id) {
|
|
|
|
- let res;
|
|
|
|
- res = await that.$api(`/viewGoods/goodsDetail`, `POST`, {
|
|
|
|
- id: id
|
|
|
|
- });
|
|
|
|
- if (res.errcode == '0') {
|
|
|
|
- console.log(res.data);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '暂无商品信息',
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-</script>
|
|
|
|
-
|
|
|
|
-<style lang="scss">
|
|
|
|
-
|
|
|
|
-</style>
|
|
|