|
|
@@ -149,6 +149,7 @@
|
|
|
<footer-share
|
|
|
style="width: 100%"
|
|
|
:isCollection="true"
|
|
|
+ :isCollectedIcon="infoObj.if_collect"
|
|
|
@collectionPages="collectionPage"
|
|
|
@sharePages="sharePage"
|
|
|
></footer-share>
|
|
|
@@ -224,6 +225,7 @@ export default {
|
|
|
},
|
|
|
data: {
|
|
|
id: ids,
|
|
|
+ openId:getApp().globalData.open_id
|
|
|
},
|
|
|
success: (res) => {
|
|
|
if (res.data.code === 200) {
|
|
|
@@ -318,18 +320,97 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
collectionPage() {
|
|
|
- console.log("已收藏");
|
|
|
- },
|
|
|
- sharePage() {
|
|
|
- console.log("分享");
|
|
|
- uni.showShareMenu({
|
|
|
- title: "园区XXX",
|
|
|
- path: "pages/park/park_detail",
|
|
|
- success(res) {
|
|
|
- console.log(res);
|
|
|
+ let md5Sign = md5(
|
|
|
+ "method=" +
|
|
|
+ "user" +
|
|
|
+ "×tamp=" +
|
|
|
+ getApp().globalData.globalTimestamp +
|
|
|
+ "&secret=" +
|
|
|
+ getApp().globalData.secret
|
|
|
+ );
|
|
|
+ let url =
|
|
|
+ getApp().globalData.shareUrl +
|
|
|
+ "api/api.php" +
|
|
|
+ "?method=user&source=policy&action=collect_add×tamp=" +
|
|
|
+ getApp().globalData.globalTimestamp +
|
|
|
+ "&sign=" +
|
|
|
+ md5Sign;
|
|
|
+ uni.request({
|
|
|
+ url: url,
|
|
|
+ method: "POST",
|
|
|
+ header: {
|
|
|
+ "content-type": "application/x-www-form-urlencoded",
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ openId :getApp().globalData.open_id,
|
|
|
+ source :'policy',
|
|
|
+ source_name :'政策',
|
|
|
+ source_id :this.infoObj.id,
|
|
|
+ source_title :this.infoObj.title
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ res.data.data ? this.infoObj.if_collect = true : this.infoObj.if_collect = false;
|
|
|
+ this.$forceUpdate();
|
|
|
+ uni.showToast({
|
|
|
+ duration:3000,
|
|
|
+ title:res.data.msg,
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ console.log("连接失败");
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+ shareRequest(){
|
|
|
+ let md5Sign = md5(
|
|
|
+ "method=" +
|
|
|
+ "user" +
|
|
|
+ "×tamp=" +
|
|
|
+ getApp().globalData.globalTimestamp +
|
|
|
+ "&secret=" +
|
|
|
+ getApp().globalData.secret
|
|
|
+ );
|
|
|
+ let url =
|
|
|
+ getApp().globalData.shareUrl +
|
|
|
+ "api/api.php" +
|
|
|
+ "?method=user&source=policy&action=repost×tamp=" +
|
|
|
+ getApp().globalData.globalTimestamp +
|
|
|
+ "&sign=" +
|
|
|
+ md5Sign;
|
|
|
+ uni.request({
|
|
|
+ url: url,
|
|
|
+ method: "POST",
|
|
|
+ header: {
|
|
|
+ "content-type": "application/x-www-form-urlencoded",
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ openId :getApp().globalData.open_id,
|
|
|
+ source_id :this.infoObj.id,
|
|
|
+ source :'policy',
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ console.log(res)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ console.log("连接失败");
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ sharePage() {
|
|
|
+ let that = this;
|
|
|
+ uni.showShareMenu({
|
|
|
+ title: that.infoObj.title,
|
|
|
+ path: "pages/policy/policy_detail?id="+that.infoObj.id,
|
|
|
+ success(res) {
|
|
|
+ that.shareRequest();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
changeScroll(height) {
|
|
|
//点的时候触发这个函数 height 是之前的高度
|
|
|
uni.pageScrollTo({
|