|
@@ -5,88 +5,69 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import diyC from './diy/index_mall.vue'
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- isDiy: uni.getStorageSync('is_diy'),
|
|
|
- shareInfo: {}
|
|
|
- }
|
|
|
- },
|
|
|
- components: {
|
|
|
- diyC
|
|
|
- },
|
|
|
- onShow() {
|
|
|
- uni.$on('is_diy', (data) => {
|
|
|
- this.isDiy = data
|
|
|
- })
|
|
|
- this.setOpenShare();
|
|
|
- },
|
|
|
- onHide() {
|
|
|
- // this.isDiy = -1
|
|
|
- },
|
|
|
- onPullDownRefresh() {
|
|
|
- this.$refs.diy.pullResh();
|
|
|
- // uni.stopPullDownRefresh()
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 微信分享;
|
|
|
- setOpenShare: function() {
|
|
|
- let that = this;
|
|
|
- // getShare().then((res) => {
|
|
|
- // let data = res.data;
|
|
|
- // this.shareInfo = data;
|
|
|
- // // #ifdef H5
|
|
|
- // let url = location.href;
|
|
|
- // if (this.$store.state.app.uid) {
|
|
|
- // url =
|
|
|
- // url.indexOf("?") === -1 ?
|
|
|
- // url + "?spread=" + this.$store.state.app.uid :
|
|
|
- // url + "&spread=" + this.$store.state.app.uid;
|
|
|
- // }
|
|
|
- // if (that.$wechat.isWeixin()) {
|
|
|
- // let configAppMessage = {
|
|
|
- // desc: data.synopsis,
|
|
|
- // title: data.title,
|
|
|
- // link: url,
|
|
|
- // imgUrl: data.img,
|
|
|
- // };
|
|
|
- // that.$wechat.wechatEvevt(
|
|
|
- // ["updateAppMessageShareData", "updateTimelineShareData"],
|
|
|
- // configAppMessage
|
|
|
- // );
|
|
|
- // }
|
|
|
- // // #endif
|
|
|
- // });
|
|
|
+import diyC from './diy/index_mall.vue'
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ isDiy: uni.getStorageSync('is_diy'),
|
|
|
+ shareInfo: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ diyC
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ uni.$on('is_diy', (data) => {
|
|
|
+ this.isDiy = data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onHide() {
|
|
|
+ // this.isDiy = -1
|
|
|
+ },
|
|
|
+ onPullDownRefresh() {
|
|
|
+ this.$refs.diy.pullResh();
|
|
|
+ // uni.stopPullDownRefresh()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ },
|
|
|
+ // onReachBottom: function() {
|
|
|
+ // if (this.isDiy) {
|
|
|
+ // this.$refs.diy.onsollBotton()
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ //#ifdef MP
|
|
|
+ //发送给朋友
|
|
|
+ onShareAppMessage: function (option) {
|
|
|
+ console.log(option)
|
|
|
+ let groupon = option.target.dataset.groupon;
|
|
|
+ let userInfo = this.$Cache.get("USER_INFO", true)
|
|
|
+ let that = this;
|
|
|
+ return {
|
|
|
+ title: groupon.mainTitle,
|
|
|
+ imageUrl: groupon.slideshow[0],
|
|
|
+ path: `/pages/groupbuying_details/index?id=${groupon.id}&selfTakeId=${that.selfTakeId}&organizerUserId=${that.organizerUserId}&inviteUserId=${userInfo.userId}`,
|
|
|
+ success(res) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '分享成功'
|
|
|
+ })
|
|
|
},
|
|
|
- },
|
|
|
- // onReachBottom: function() {
|
|
|
- // if (this.isDiy) {
|
|
|
- // this.$refs.diy.onsollBotton()
|
|
|
- // }
|
|
|
- // },
|
|
|
- // #ifdef MP
|
|
|
- //发送给朋友
|
|
|
- onShareAppMessage(res) {
|
|
|
- // 此处的distSource为分享者的部分信息,需要传递给其他人
|
|
|
- let that = this;
|
|
|
- return {
|
|
|
- title: this.shareInfo.title,
|
|
|
- path: "/pages/index/index",
|
|
|
- imageUrl: this.shareInfo.img,
|
|
|
- };
|
|
|
- },
|
|
|
- //分享到朋友圈
|
|
|
- onShareTimeline() {
|
|
|
- return {
|
|
|
- title: this.shareInfo.title,
|
|
|
- imageUrl: this.shareInfo.img,
|
|
|
- };
|
|
|
- },
|
|
|
- // #endif
|
|
|
- }
|
|
|
+ fail(res) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '分享失败',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //分享到朋友圈
|
|
|
+ // onShareTimeline() {
|
|
|
+ // return {
|
|
|
+ // title: this.shareInfo.title,
|
|
|
+ // imageUrl: this.shareInfo.img,
|
|
|
+ // };
|
|
|
+ // },
|
|
|
+ //#endif
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
-
|
|
|
-</style>
|
|
|
+<style></style>
|