作者 燕成杰

合并分支 'yan' 到 'master'

Yan



查看合并请求 !18
@@ -12,10 +12,10 @@ @@ -12,10 +12,10 @@
12 12
13 if (!openId && !e.query.code) { 13 if (!openId && !e.query.code) {
14 console.log('获取code'); 14 console.log('获取code');
15 - // getApp().authorization() 15 + getApp().authorization()
16 } else if (e.query.code) { 16 } else if (e.query.code) {
17 console.log(2); 17 console.log(2);
18 - // getApp().getOpenid(e.query.code) 18 + getApp().getOpenid(e.query.code)
19 } 19 }
20 // else { 20 // else {
21 // uni.showModal({ 21 // uni.showModal({
@@ -15,7 +15,7 @@ export const arcList = () => request({url: 'index/arc_list',method: 'post',data @@ -15,7 +15,7 @@ export const arcList = () => request({url: 'index/arc_list',method: 'post',data
15 export const product_list = (data) => request({url: 'product/product_list',method: 'post',data: data}) 15 export const product_list = (data) => request({url: 'product/product_list',method: 'post',data: data})
16 16
17 // 首页产品详情 17 // 首页产品详情
18 -export const product_detail = (product_id) => request({url: 'product/product_detail',method: 'post',data: {product_id}}) 18 +export const product_detail = (product_id,url) => request({url: 'product/product_detail',method: 'post',data: {product_id,url}})
19 19
20 // 首页产品下单 20 // 首页产品下单
21 export const product_buy = (data) => request({url: 'product/product_buy',method: 'post',data: data}) 21 export const product_buy = (data) => request({url: 'product/product_buy',method: 'post',data: data})
@@ -126,6 +126,7 @@ @@ -126,6 +126,7 @@
126 </view> 126 </view>
127 </view> 127 </view>
128 </u-popup> 128 </u-popup>
  129 + <image class="home" @click="goHome" src="/static/home.png" mode=""></image>
129 <view class="share" v-if="shareModel" @click="shareModel=false"> 130 <view class="share" v-if="shareModel" @click="shareModel=false">
130 <image src="../../static/detailShare.png" mode=""></image> 131 <image src="../../static/detailShare.png" mode=""></image>
131 <view class=""> 132 <view class="">
@@ -136,7 +137,7 @@ @@ -136,7 +137,7 @@
136 </template> 137 </template>
137 138
138 <script> 139 <script>
139 - var jweixin = require('jweixin-module'); 140 + var jweixin = require('jweixin-module');
140 import { 141 import {
141 product_detail, 142 product_detail,
142 product_favorite, 143 product_favorite,
@@ -158,7 +159,8 @@ @@ -158,7 +159,8 @@
158 sort: { 159 sort: {
159 name: "" 160 name: ""
160 } 161 }
161 - }, 162 + },
  163 + jssdk:{},
162 list1: [], //轮播图 164 list1: [], //轮播图
163 range: [{ 165 range: [{
164 value: 0, 166 value: 0,
@@ -190,9 +192,27 @@ @@ -190,9 +192,27 @@
190 this.report_list() 192 this.report_list()
191 }, 193 },
192 methods: { 194 methods: {
  195 + goHome(){
  196 + uni.reLaunch({
  197 + url:'/pages/index/index'
  198 + })
  199 + },
193 share(){ 200 share(){
194 let that = this; 201 let that = this;
  202 + jweixin.config({
  203 + debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  204 + appId: that.jssdk.appId, // 必填,公众号的唯一标识
  205 + timestamp: that.jssdk.timestamp, // 必填,生成签名的时间戳
  206 + nonceStr: that.jssdk.nonceStr, // 必填,生成签名的随机串
  207 + signature: that.jssdk.signature, // 必填,签名
  208 + jsApiList: that.jssdk.jsApiList // 必填,需要使用的JS接口列表
  209 + })
  210 + jweixin.error(function(res) {
  211 + console.log(res, '错误')
  212 + });
  213 + console.log('分享了',that.jssdk.signature);
195 jweixin.ready(function() { 214 jweixin.ready(function() {
  215 +
196 //分享给朋友 216 //分享给朋友
197 jweixin.onMenuShareAppMessage({ 217 jweixin.onMenuShareAppMessage({
198 title: that.detail.name, // 分享标题 218 title: that.detail.name, // 分享标题
@@ -257,7 +277,7 @@ @@ -257,7 +277,7 @@
257 this.show = false 277 this.show = false
258 }, 278 },
259 change(e) { 279 change(e) {
260 - console.log("e:", e); 280 + // console.log("e:", e);
261 }, 281 },
262 //选中效果 282 //选中效果
263 choosritem(name, id) { 283 choosritem(name, id) {
@@ -322,11 +342,12 @@ @@ -322,11 +342,12 @@
322 } 342 }
323 }, 343 },
324 //详情 344 //详情
325 - async product_detail() { 345 + async product_detail() {
326 try { 346 try {
327 - const res = await product_detail(this.id) 347 + const res = await product_detail(this.id,window.location.href)
328 console.log('product_detail', res) 348 console.log('product_detail', res)
329 - this.detail = res.detail 349 + this.detail = res.detail
  350 + this.jssdk = res.jssdk
330 this.list1 = res.detail.images_preview 351 this.list1 = res.detail.images_preview
331 this.share() 352 this.share()
332 // 保存数据 353 // 保存数据
@@ -343,7 +364,8 @@ @@ -343,7 +364,8 @@
343 uni.navigateTo({ 364 uni.navigateTo({
344 url: "/pages/index/buy?id=" + this.id 365 url: "/pages/index/buy?id=" + this.id
345 }) 366 })
346 - }, 367 + },
  368 +
347 }, 369 },
348 } 370 }
349 </script> 371 </script>
@@ -670,5 +692,12 @@ @@ -670,5 +692,12 @@
670 font-size: 36rpx; 692 font-size: 36rpx;
671 font-weight: 700; 693 font-weight: 700;
672 } 694 }
  695 + }
  696 + .home {
  697 + width: 96rpx;
  698 + height: 96rpx;
  699 + position: fixed;
  700 + right: 28rpx;
  701 + bottom: 186rpx;
673 } 702 }
674 </style> 703 </style>
@@ -100,6 +100,7 @@ @@ -100,6 +100,7 @@
100 </view> 100 </view>
101 </view> 101 </view>
102 </view> 102 </view>
  103 + <image class="goTop" @click="goTop" src="/static/top.png" mode=""></image>
103 <Botton :flag="1"></Botton> 104 <Botton :flag="1"></Botton>
104 </view> 105 </view>
105 </template> 106 </template>
@@ -137,16 +138,20 @@ @@ -137,16 +138,20 @@
137 }, 138 },
138 onShow() { 139 onShow() {
139 this.initial() 140 this.initial()
140 - this.product_list(true)  
141 }, 141 },
142 onLoad() { 142 onLoad() {
143 - 143 + this.product_list(true)
144 }, 144 },
145 onReachBottom() { 145 onReachBottom() {
146 this.currentpage++ 146 this.currentpage++
147 this.product_list() 147 this.product_list()
148 }, 148 },
149 methods: { 149 methods: {
  150 + goTop(){
  151 + uni.pageScrollTo({
  152 + scrollTop: 0
  153 + });
  154 + },
150 // 资讯详情 155 // 资讯详情
151 oncusdetail(e) { 156 oncusdetail(e) {
152 uni.navigateTo({ 157 uni.navigateTo({
@@ -602,4 +607,11 @@ @@ -602,4 +607,11 @@
602 } 607 }
603 } 608 }
604 } 609 }
  610 + .goTop {
  611 + width: 96rpx;
  612 + height: 96rpx;
  613 + position: fixed;
  614 + right: 28rpx;
  615 + bottom: 186rpx;
  616 + }
605 </style> 617 </style>
@@ -171,7 +171,7 @@ @@ -171,7 +171,7 @@
171 }, 171 },
172 openshowBuyer(item) { 172 openshowBuyer(item) {
173 this.showBuyer = true 173 this.showBuyer = true
174 - this.code = item.buyer_name 174 + this.code = item.buyer_package
175 this.wechart = item.buyer_wechat 175 this.wechart = item.buyer_wechat
176 this.name = item.buyer_name 176 this.name = item.buyer_name
177 this.phone = item.buyer_mobile 177 this.phone = item.buyer_mobile
1 <!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>元届印象</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) 1 <!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>元届印象</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
2 - document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.f3bf79df.js></script><script src=/static/js/index.bdc7f535.js></script></body></html>  
  2 + document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.f3bf79df.js></script><script src=/static/js/index.ce24accb.js></script></body></html>