diff --git a/App.vue b/App.vue
index 8e1ba4d..6366b76 100644
--- a/App.vue
+++ b/App.vue
@@ -17,11 +17,11 @@
import updata from '@/uni_modules/uni-upgrade-center-app/utils/check-update'
// #endif
import Vue from 'vue'
-
+
export default {
- data(){
- return{
- platform:null, // 系统
+ data() {
+ return {
+ platform: null, // 系统
}
},
onLaunch: function(e) {
@@ -144,10 +144,10 @@
}
// APPUpdate();
// #endif
-
+
},
- onShow: function(e) {
-
+ onShow: function(e) {
+ // console.log(plus.runtime.arguments, 'plus.runtime.arguments-----')
// #ifdef MP-WEIXIN
//获取二维码携带的参数
let scene = decodeURIComponent(e.query.scene);
@@ -200,8 +200,7 @@
})
console.log('页面销毁')
},
- methods: {
- }
+ methods: {}
};
diff --git a/config/requestConfig.js b/config/requestConfig.js
index 57862e2..f154b86 100644
--- a/config/requestConfig.js
+++ b/config/requestConfig.js
@@ -128,7 +128,7 @@ $http.requestStart = function(options) {
}
if (storeUserInfo.token) {
options.header['token'] = storeUserInfo.token;
- };
+ };
return options;
}
//请求结束
diff --git a/pages.json b/pages.json
index 2eaaa08..ede6d5b 100644
--- a/pages.json
+++ b/pages.json
@@ -602,6 +602,13 @@
"navigationBarTitleText": "国学经典",
"enablePullDownRefresh": false
}
+ },
+ {
+ "path" : "pages/news/news",
+ "style" :
+ {
+ "navigationBarTitleText" : "新闻播报"
+ }
}
// {
// "path": "pages/agreement/yszcPage",
diff --git a/pages/bookShop/commodityDetail.vue b/pages/bookShop/commodityDetail.vue
index b1da978..91f8b53 100644
--- a/pages/bookShop/commodityDetail.vue
+++ b/pages/bookShop/commodityDetail.vue
@@ -2,8 +2,11 @@
+
@@ -13,6 +16,10 @@
+
¥{{ productInfo.activityPrice }}
@@ -273,6 +280,10 @@
+
+
+
+
@@ -301,7 +312,12 @@ export default {
options: [{
icon: 'cart',
text: '购物车'
- }],
+ },
+ {
+ icon: 'redo',
+ text: '分享'
+ }
+ ],
buttonGroup: [{
text: '加入购物车',
backgroundColor: 'linear-gradient(90deg, #FFCD1E, #FF8A18)',
@@ -370,6 +386,51 @@ export default {
// break;
}
},
+ // 新写分享
+ newOnShare() {
+ this.$refs.share.open()
+ },
+ haveSelected(data) {
+ let image = ''
+ this.productInfo.productImages && this.productInfo.productImages != '' ? image = this.productInfo.productImages : image =
+ 'static/fengziIcon.jpg'
+ console.log(data, ' 选择的是')
+ if (data.index == 0) {
+ // 分享到好友
+ uni.share({
+ provider: "weixin",
+ scene: "WXSceneSession",
+ type: 0,
+ href: this.$apkUrl,
+ title: `${this.productInfo.productName}`,
+ // summary: `${this.productInfo.content}`,
+ imageUrl: image,
+ success: function(res) {
+ console.log("success:" + JSON.stringify(res));
+ },
+ fail: function(err) {
+ console.log("fail:" + JSON.stringify(err));
+ }
+ });
+ } else if (data.index == 1) {
+ // 分享到朋友圈
+ uni.share({
+ provider: "weixin",
+ scene: "WXSceneTimeline",
+ type: 0,
+ href: this.$apkUrl,
+ title: `${this.productInfo.productName}`,
+ // summary: `${this.taskInfo.content}`,
+ imageUrl: image,
+ success: function(res) {
+ console.log("success:" + JSON.stringify(res));
+ },
+ fail: function(err) {
+ console.log("fail:" + JSON.stringify(err));
+ }
+ });
+ }
+ },
showImg(e) {
// console.log(e,'点击的内容')
// let contentimg = e.target.dataset.nodes;
@@ -541,10 +602,14 @@ export default {
},
// 点击购物车
onClick(e) {
- console.log(e.content.text)
- uni.navigateTo({
- url: '../peanut/shopping'
- });
+ console.log(e.content)
+ if(e.content.text == '分享'){
+ this.$refs.share.open()
+ }else{
+ uni.navigateTo({
+ url: '../peanut/shopping'
+ });
+ }
},
// 关联商品点击按钮组件
buttonClickLink(e) {
@@ -1298,4 +1363,5 @@ export default {
.quanyi_book {
margin-bottom: 20rpx;
}
+.icon_setUp{margin-right: 10px;}
\ No newline at end of file
diff --git a/pages/news/news.vue b/pages/news/news.vue
new file mode 100644
index 0000000..9b0e247
--- /dev/null
+++ b/pages/news/news.vue
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+ {{news.title}}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/peanut/home.vue b/pages/peanut/home.vue
index 6daf0aa..e749f65 100644
--- a/pages/peanut/home.vue
+++ b/pages/peanut/home.vue
@@ -143,6 +143,23 @@
书名检索
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+
+
+
+
@@ -394,6 +411,7 @@
userMsg: {}, // 用户信息
yxCurIndex: 0, // 当前营销标签序号
SystemInfoSync: {}, // 屏幕尺寸
+ newsList: [], // 播报新闻列表
};
},
onPageScroll(e) {
@@ -438,11 +456,12 @@
// 下拉刷新
onPullDownRefresh() {
this.page = 1
- this.tjProList = []
- this.getUserInfo()
+ // this.tjProList = []
+ // this.getUserInfo()
// this.getData()
- this.getTags()
- this.getYXTgs()
+ // this.getTags()
+ // this.getYXTgs()
+ this.requestAll()
// this.requestIapOrder()
uni.stopPullDownRefresh()
@@ -489,6 +508,45 @@
// this.getData();
this.getTags()
this.getYXTgs()
+ this.getNewsList()
+ },
+ newsClick(item) {
+ if (item.type == 1) { // url跳转
+ if (item.url != '') {
+ this.openURL(item.url)
+ } else {
+ console.log('跳转链接为空')
+ }
+ } else { // 内部跳转
+ uni.navigateTo({
+ url: '/pages/news/news?newsid=' + item.id
+ })
+ }
+ },
+ // 获取播报新闻列表
+ getNewsList() {
+ $http.request({
+ url: "common/message/listByPage",
+ method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
+ data: {
+ "isBook": 1, //是否是疯子读书0否1是
+ "isMedical": 0, //是否是吴门医述0否1是
+ "isSociology": 0 //是否是众妙之门0否1是
+ },
+ header: { //默认 无 说明:请求头
+ 'Content-Type': 'application/json'
+ },
+ })
+ .then(res => {
+ if (res.code == 0) {
+ if (res.messages.length > 0) {
+ this.newsList = res.messages
+ } else {
+ this.newsList = []
+ }
+ }
+
+ });
},
// 获取营销标签列表
getYXTgs() {
@@ -905,6 +963,41 @@