|
@@ -184,6 +184,9 @@
|
|
|
|
|
|
|
|
<uni-popup ref="rightShowMore" background-color="#fff" type="center" :animation="true" class="class-popup-style">
|
|
<uni-popup ref="rightShowMore" background-color="#fff" type="center" :animation="true" class="class-popup-style">
|
|
|
<view class="action-popup-container">
|
|
<view class="action-popup-container">
|
|
|
|
|
+ <view class="action-button-item">
|
|
|
|
|
+ <button class="action-button" @click="shareGoods()">分享到微信</button>
|
|
|
|
|
+ </view>
|
|
|
<view class="action-button-item">
|
|
<view class="action-button-item">
|
|
|
<button class="action-button" @click="getMyPoster()">分享海报</button>
|
|
<button class="action-button" @click="getMyPoster()">分享海报</button>
|
|
|
</view>
|
|
</view>
|
|
@@ -201,9 +204,11 @@
|
|
|
import AppSearchModule from "@/components/module/app-search"
|
|
import AppSearchModule from "@/components/module/app-search"
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty"
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty"
|
|
|
import {categoryListInfo,getCategoryToGoods,print,getRise,getPoster} from "@/api/goods"
|
|
import {categoryListInfo,getCategoryToGoods,print,getRise,getPoster} from "@/api/goods"
|
|
|
|
|
+import { getWeixinId } from "@/api/invite"
|
|
|
import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue'
|
|
import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue'
|
|
|
import ItemPosterPopup from '@/components/item-poster-popup.vue'
|
|
import ItemPosterPopup from '@/components/item-poster-popup.vue'
|
|
|
import { list } from "@/mixins"
|
|
import { list } from "@/mixins"
|
|
|
|
|
+import { mapGetters } from "vuex"
|
|
|
export default {
|
|
export default {
|
|
|
name: "list",
|
|
name: "list",
|
|
|
components: {
|
|
components: {
|
|
@@ -241,6 +246,7 @@ export default {
|
|
|
],
|
|
],
|
|
|
currentInfo: {},
|
|
currentInfo: {},
|
|
|
posterUrl: '',
|
|
posterUrl: '',
|
|
|
|
|
+ getAppIdList: {},
|
|
|
flowerNumOptions: [
|
|
flowerNumOptions: [
|
|
|
{ label: '6支', value: 6 },
|
|
{ label: '6支', value: 6 },
|
|
|
{ label: '9支', value: 9 },
|
|
{ label: '9支', value: 9 },
|
|
@@ -255,12 +261,19 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
computed: {
|
|
|
|
|
+ ...mapGetters({ loginInfo: "getLoginInfo", dictInfo: "getDictionariesInfo" }),
|
|
|
// 检查是否有活跃的筛选条件
|
|
// 检查是否有活跃的筛选条件
|
|
|
hasActiveFilters() {
|
|
hasActiveFilters() {
|
|
|
return this.flowerNum != 0 || this.hasStock!=-1
|
|
return this.flowerNum != 0 || this.hasStock!=-1
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ onLoad() {
|
|
|
|
|
+ getWeixinId().then(res => {
|
|
|
|
|
+ this.getAppIdList = res.data
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
onShow() {
|
|
onShow() {
|
|
|
// 检查是否需要刷新数据
|
|
// 检查是否需要刷新数据
|
|
|
const shouldRefresh = uni.getStorageSync('goods_list_refresh');
|
|
const shouldRefresh = uni.getStorageSync('goods_list_refresh');
|
|
@@ -384,6 +397,51 @@ export default {
|
|
|
closeRightShow() {
|
|
closeRightShow() {
|
|
|
this.$refs.rightShowMore.close()
|
|
this.$refs.rightShowMore.close()
|
|
|
},
|
|
},
|
|
|
|
|
+ shareGoods() {
|
|
|
|
|
+ const that = this
|
|
|
|
|
+ const id = this.currentInfo.id
|
|
|
|
|
+ this.closeRightShow()
|
|
|
|
|
+ const sharePath = 'pages/goods/detail?shopId=' + that.loginInfo.shopId + '&ghsShopAdminId=' + that.loginInfo.shopAdminId + '&id=' + id
|
|
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
|
|
+ uni.navigateToMiniProgram({
|
|
|
|
|
+ appId: that.getAppIdList.mall.miniAppId,
|
|
|
|
|
+ path: sharePath,
|
|
|
|
|
+ envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
|
|
|
|
|
+ extraData: {
|
|
|
|
|
+ shopId: that.loginInfo.shopId,
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ name: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ success() {}
|
|
|
|
|
+ })
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ // #ifdef APP-PLUS
|
|
|
|
|
+ if (plus.runtime.isApplicationExist({ pname: 'com.tencent.mm', action: 'weixin://' })) {
|
|
|
|
|
+ plus.share.getServices(function(s) {
|
|
|
|
|
+ let sweixin
|
|
|
|
|
+ for (let i = 0; i < s.length; i++) {
|
|
|
|
|
+ if (s[i].id == 'weixin') {
|
|
|
|
|
+ sweixin = s[i]
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ const miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.mall ? that.dictInfo.miniOriginalId.current.mall : ''
|
|
|
|
|
+ if (sweixin) {
|
|
|
|
|
+ sweixin.launchMiniProgram({
|
|
|
|
|
+ id: miniOriginalId,
|
|
|
|
|
+ path: sharePath,
|
|
|
|
|
+ type: 0
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ that.$msg('没有找到微信服务')
|
|
|
|
|
+ }
|
|
|
|
|
+ }, function() {
|
|
|
|
|
+ that.$msg('没有找到微信服务哦')
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$msg('请安装微信,再打开小程序')
|
|
|
|
|
+ }
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ },
|
|
|
closePoster() {
|
|
closePoster() {
|
|
|
this.$refs.itemPosterPopup.close()
|
|
this.$refs.itemPosterPopup.close()
|
|
|
},
|
|
},
|