作者 朱振飞

Merge branch 'master' of http://114.215.101.231:8099/miniprogram/jiuzidian

# Conflicts:
#	app.json
#	pages/homapage/homepage.wxml
#	pages/homeblock/search/search.wxss
#	pages/homeblock/shipaiimg/shipaiimg.wxml
#	project.config.json

要显示太多修改。

为保证性能只显示 32 of 32+ 个文件。

@@ -84,6 +84,50 @@ App({ @@ -84,6 +84,50 @@ App({
84 return promise; 84 return promise;
85 }, 85 },
86 86
  87 + // 上传图片
  88 + upload(filetype, file) {
  89 +
  90 + var promise = new Promise((resolve, reject) => {
  91 +
  92 + let url = 'https://winesbook.cn/api/user/upload/one';
  93 + let head = {
  94 + 'XX-Token': wx.getStorageSync('token'),
  95 + 'XX-Device-Type': 'wxapp'
  96 + }
  97 + let typename = {
  98 + filetype: filetype
  99 + }
  100 + wx.uploadFile({
  101 + url: url, //仅为示例,非真实的接口地址
  102 + filePath: file,
  103 + name: 'file',
  104 + header: head,
  105 + formData: typename,
  106 + success: function (res) {
  107 + console.log('上传文件后', res)
  108 + let temdata = JSON.parse(res.data);
  109 + console.log(temdata)
  110 + let urlobj = {
  111 + url: temdata.data.url,
  112 + local_url: temdata.data.local_url
  113 + }
  114 + resolve(urlobj);
  115 + wx.hideNavigationBarLoading();
  116 + wx.hideLoading();
  117 + },
  118 + fail: function (res) {
  119 + reject('网络出错');
  120 + wx.hideNavigationBarLoading()
  121 + wx.hideLoading()
  122 + },
  123 + complete: () => {
  124 + wx.hideNavigationBarLoading()
  125 + wx.hideLoading()
  126 + },
  127 + })
  128 + });
  129 + return promise;
  130 + },
87 nowDate() { 131 nowDate() {
88 let date = new Date(); 132 let date = new Date();
89 let month = date.getMonth() + 1; 133 let month = date.getMonth() + 1;
@@ -2,20 +2,20 @@ @@ -2,20 +2,20 @@
2 "pages": [ 2 "pages": [
3 "pages/login/login", 3 "pages/login/login",
4 "pages/homapage/homepage", 4 "pages/homapage/homepage",
  5 + "pages/homeblock/zhinengselect/zhinengselect",
5 "pages/homeblock/search/search", 6 "pages/homeblock/search/search",
6 "pages/find/find", 7 "pages/find/find",
7 "pages/index/index", 8 "pages/index/index",
8 "pages/logs/logs", 9 "pages/logs/logs",
9 "pages/mine/mine", 10 "pages/mine/mine",
10 "pages/myblock/personpage/personpage", 11 "pages/myblock/personpage/personpage",
  12 + "pages/homeblock/niangjiuteacher/niangjiuteacher",
11 "pages/homeblock/brandlist/brandlist", 13 "pages/homeblock/brandlist/brandlist",
12 "pages/homeblock/brandpage/brandpage", 14 "pages/homeblock/brandpage/brandpage",
13 "pages/homeblock/companyintro/companyintro", 15 "pages/homeblock/companyintro/companyintro",
14 - "pages/homeblock/zhinengselect/zhinengselect",  
15 "pages/homeblock/shipaiimg/shipaiimg", 16 "pages/homeblock/shipaiimg/shipaiimg",
16 "pages/homeblock/guanimg/guanimg", 17 "pages/homeblock/guanimg/guanimg",
17 "pages/homeblock/shortvideo/shortvideo", 18 "pages/homeblock/shortvideo/shortvideo",
18 - "pages/homeblock/niangjiuteacher/niangjiuteacher",  
19 "pages/homeblock/jiuzidian/jiuzidian", 19 "pages/homeblock/jiuzidian/jiuzidian",
20 "pages/homeblock/evalute/evalute", 20 "pages/homeblock/evalute/evalute",
21 "pages/homeblock/evalutecontent/evalutecontent", 21 "pages/homeblock/evalutecontent/evalutecontent",
@@ -28,8 +28,12 @@ @@ -28,8 +28,12 @@
28 "pages/forgetmima/forgetmima", 28 "pages/forgetmima/forgetmima",
29 "pages/wanshangeren/wanshangeren", 29 "pages/wanshangeren/wanshangeren",
30 "pages/peopleinfo/peopleinfo", 30 "pages/peopleinfo/peopleinfo",
31 - "pages/myblock/history/history",  
32 - "pages/jiudan/jiudan" 31 + "pages/myblock/jifenjilu/jifenjilu",
  32 + "pages/myblock/pingjia/pingjia",
  33 + "pages/myblock/niangjiulist/niangjiulist",
  34 + "pages/myblock/shezhimima/shezhimima",
  35 + "pages/homeblock/video/video",
  36 + "pages/homeblock/shuxing/shuxing"
33 ], 37 ],
34 "window": { 38 "window": {
35 "backgroundTextStyle": "light", 39 "backgroundTextStyle": "light",
@@ -64,7 +64,8 @@ image{ @@ -64,7 +64,8 @@ image{
64 /* 关注 */ 64 /* 关注 */
65 65
66 .atten{ 66 .atten{
67 - width:100rpx; 67 + /* width:100rpx; */
  68 + padding: 0 20rpx;
68 height:50rpx; 69 height:50rpx;
69 background:rgba(232,24,37,1); 70 background:rgba(232,24,37,1);
70 border-radius:2rpx; 71 border-radius:2rpx;
@@ -191,6 +191,14 @@ Page({ @@ -191,6 +191,14 @@ Page({
191 }) 191 })
192 }, 192 },
193 193
  194 + //进入品牌页
  195 + jumpbrand(e){
  196 + let id=e.currentTarget.dataset.id;
  197 + wx.navigateTo({
  198 + url: '/pages/homeblock/brandlist/brandlist?id='+id,
  199 + })
  200 + },
  201 +
194 202
195 //获取用户当前位置 203 //获取用户当前位置
196 getcity() { 204 getcity() {
@@ -639,8 +647,11 @@ Page({ @@ -639,8 +647,11 @@ Page({
639 }, 647 },
640 648
641 //筛选 649 //筛选
642 - shai(){  
643 - this.gethomeindex() 650 + shaixuan(){
  651 + wx.navigateTo({
  652 + url: '/pages/homeblock/zhinengselect/zhinengselect',
  653 + })
  654 + // this.gethomeindex()
644 }, 655 },
645 656
646 657
  1 +<!-- 种类的遮罩层 -->
  2 +
  3 +<view class="register" wx:if="{{shai}}" bindtap="hideregister">
  4 + <view class="registerwrap">
  5 + <view class="registeritem {{item.sel==true?'selact':''}}" wx:for="{{shaikind}}" wx:key="" wx:if="{{type==1}}" data-id="{{item.id}}" catchtap='selectkind'>{{item.sort_name}}</view>
  6 + <view class="registeritem {{item.sel==true?'selact':''}}" wx:for="{{shaikind}}" wx:key="" wx:if="{{type==2}}" data-id="{{item.id}}" catchtap='selectkind'>{{item.country_name}}</view>
  7 + <view class="registeritem {{item.sel==true?'selact':''}}" wx:for="{{shaikind}}" wx:key="" wx:if="{{type==3}}" data-id="{{item.id}}" catchtap='selectkind'>{{item.region_name}}</view>
  8 + <view class="registeritem {{item.sel==true?'selact':''}}" wx:for="{{shaikind}}" wx:key="" wx:if="{{type==4}}" data-id="{{item.id}}" catchtap='selectkind'>{{item.odor_name}}</view>
  9 + </view>
  10 +</view>
  11 +
  12 +<!-- 国家遮罩层 -->
  13 +<view class="cregister" wx:if="{{showcountry}}">
  14 + <view class="quehead">
  15 + <view class="backrow"></view>
  16 + <view class="selcoun">选择国别</view>
  17 + <view class="cqueding" bindtap="countrysure">确定</view>
  18 + </view>
  19 + <view class="countryitem" wx:for="{{countrylist}}" wx:key="" data-name="{{item.country_name}}" bindtap="selectcountry" data-id="{{item.id}}">
  20 + <view class="selcounitem">{{item.country_name}}</view>
  21 + <view class="gouimg" wx:if="{{item.sel==true}}">
  22 + <image src="{{url}}/aicon_18x.png"></image>
  23 + </view>
  24 + </view>
  25 +</view>
  26 +<!-- 城市遮罩层 -->
  27 +<view class="cregister" wx:if="{{showcity}}">
  28 + <view class="quehead">
  29 + <view class="backrow"></view>
  30 + <view class="selcoun">选择城市</view>
  31 + <view class="cqueding" bindtap="citysure">确定</view>
  32 + </view>
  33 + <view class="nodata" wx:if="{{citylist.length==0}}">暂无数据</view>
  34 + <block wx:else>
  35 + <view class="countryitem" wx:for="{{citylist}}" wx:key="" data-name="{{item.country_name}}" bindtap="selectcity" data-index="{{index}}">
  36 + <view class="selcounitem">{{item.city}}</view>
  37 + <!-- <view class="gouimg" wx:if="{{item.sel==true}}">
  38 + <image src="{{url}}/aicon_18x.png"></image>
  39 + </view> -->
  40 + </view>
  41 + </block>
  42 +</view>
  43 +<!-- 区域选择 -->
  44 +<view class="cregister" wx:if="{{showregin}}">
  45 + <view class="quehead">
  46 + <view class="backrow"></view>
  47 + <view class="selcoun">选择区</view>
  48 + <view class="cqueding" bindtap="sureregin">确定</view>
  49 + </view>
  50 +
  51 +
  52 +
  53 + <view class="countryitem" wx:for="{{reginlist}}" wx:key="" data-name="{{item.name}}" bindtap="selectregin" data-index="{{index}}">
  54 + <view class="selcounitem">{{item.name}}</view>
  55 +
  56 + <view class="gouimg" wx:if="{{item.sel==true}}">
  57 + <image src="{{url}}/aicon_18x.png"></image>
  58 + </view>
  59 + </view>
  60 +
  61 +
  62 +
  63 +
  64 +</view>
  65 +<view class="heatop">
  66 + <view class="head">
  67 + <view class="address">
  68 + <view class="addressimg">
  69 + <image src='{{url}}bicon_01x.png'></image>
  70 + </view>
  71 +
  72 + <view class="addressname">{{currentCity}}</view>
  73 + </view>
  74 +
  75 + <view class="headmiddle" bindtap="entersearch">
  76 + <view class="searchimg">
  77 + <image src="{{url}}aicon_04@2x.png"></image>
  78 + </view>
  79 +
  80 + <view class="searchinput">
  81 + <input placeholder='已收录298653款酒品' placeholder-class='seachenter' value="{{record}}" />
  82 + </view>
  83 +
  84 + <view class="saoma">
  85 + <image src="{{url}}bicon_04@2x.png"></image>
  86 + </view>
  87 + </view>
  88 +
  89 + <view class="address" bindtap="shaixuan">
  90 + <view class="shaixuan">
  91 + <image src='{{url}}bicon_02@2x.png'></image>
  92 + </view>
  93 +
  94 + <view class="addressname shai">筛选</view>
  95 + </view>
  96 +
  97 + </view>
  98 + <!-- 筛选 -->
  99 + <view class="shaisel">
  100 + <view class="shaikind" bindtap="shaikind" data-type="{{item.type}}" wx:for="{{kindlist}}" wx:key="">
  101 + <view class="shaikindname">{{item.name}}</view>
  102 + <view class="shaikindimg">
  103 + <image src="{{url}}bicon_06x.png" wx:if="{{item.sel==true}}"></image>
  104 + <image src="{{url}}bicon_05x.png" wx:else></image>
  105 +
  106 + </view>
  107 + </view>
  108 + </view>
  109 +
  110 + <!-- <view class="hot">
  111 + <view class="hotimg">
  112 + <image src="{{url}}bicon_08@2x.png"></image>
  113 + </view>
  114 +
  115 + <view class="hotzi">
  116 + <image src="{{url}}bicon_07@2x.png"></image>
  117 + </view>
  118 +</view> -->
  119 +</view>
  120 +<view class='city_box'>
  121 + <view class='city_left'>
  122 + <scroll-view scroll-y style='width:100%;height:100%;' scroll-with-animation scroll-into-view='{{cityListId}}'>
  123 + <view class="hot">
  124 + <view class="hotimg">
  125 + <image src="{{url}}bicon_08@2x.png"></image>
  126 + </view>
  127 +
  128 + <view class="hotzi">
  129 + <image src="{{url}}bicon_07@2x.png"></image>
  130 + </view>
  131 + </view>
  132 + <view class='new_city'>
  133 +
  134 + <view class='new_city_box'>
  135 + <view class='new_city_text' wx:for='{{newcity}}' wx:key='this' data-types='new' catchtap='cityTap' data-val='{{item}}'>
  136 + <view class="hotgood" bindtap="jumpbrand" data-id="{{item.id}}">
  137 + <view class="imgleft">
  138 + <image src="{{item.logo}}" mode='widthFix'></image>
  139 + </view>
  140 + <view class="contentright">
  141 + <view class="contenttop">{{item.name}}</view>
  142 + <view class="contenbottom">
  143 + <text class="textname">{{item.sort_name}}</text>
  144 + <text class="textname">{{item.country}}</text>
  145 + <text class="textname">{{item.city}}</text>
  146 + <text class="textname">{{item.odor_name}}</text>
  147 + </view>
  148 + </view>
  149 +
  150 + </view>
  151 +
  152 + </view>
  153 + </view>
  154 + </view>
  155 +
  156 +
  157 +
  158 + <view class='city_list_box'>
  159 + <block wx:for='{{citylist}}' wx:key='this' wx:for-item='letterItem' wx:for-index='letterIndex'>
  160 + <view class='city_first_letter' id='{{letterItem.name}}'>{{letterItem.name}}</view>
  161 + <!-- {{item.cityName}} -->
  162 + <view class='city_name' wx:for='{{letterItem.list}}' id='{{letterItem.name}}' wx:key='this' data-types='list' catchtap='cityTap' data-index='{{index}}' data-val='{{item}}'>
  163 +
  164 + <view class="imgleft">
  165 + <image src="{{item.logo}}"></image>
  166 + </view>
  167 + <view class="contentright">
  168 + <view class="contenttop">{{item.name}}</view>
  169 + <view class="contenbottom">
  170 + <text class="textname">{{item.sort_name}}</text>
  171 + <text class="textname">{{item.country}}</text>
  172 + <text class="textname"> {{item.city}} </text>
  173 + <text class="textname">{{item.odor_name}}</text> </view>
  174 + </view>
  175 +
  176 + </view>
  177 + </block>
  178 + </view>
  179 + </scroll-view>
  180 + </view>
  181 + <view class='city_right'>
  182 + <text class='letter_item' wx:for='{{letter}}' wx:key='this' catchtap='letterTap' data-item='{{item}}'>{{item}}</text>
  183 + </view>
  184 +</view>
@@ -8,7 +8,12 @@ Page({ @@ -8,7 +8,12 @@ Page({
8 data: { 8 data: {
9 navbar: ['在售','预售','停产在售','停售'], 9 navbar: ['在售','预售','停产在售','停售'],
10 currentTab: 0, 10 currentTab: 0,
11 - url:"" 11 + url:"",
  12 + status:1,
  13 + brandid:'',
  14 + page:1,
  15 + info:'',
  16 + brandlist:[]
12 17
13 }, 18 },
14 19
@@ -16,15 +21,101 @@ Page({ @@ -16,15 +21,101 @@ Page({
16 * 生命周期函数--监听页面加载 21 * 生命周期函数--监听页面加载
17 */ 22 */
18 onLoad: function (options) { 23 onLoad: function (options) {
  24 + console.log(options)
19 this.setData({ 25 this.setData({
20 - url: app.globalData.url 26 + url: app.globalData.url,
  27 + brandid:options.id
21 }) 28 })
  29 +
  30 + this.getbrandlist()
22 }, 31 },
23 navbarTap: function (e) { 32 navbarTap: function (e) {
24 this.setData({ 33 this.setData({
25 currentTab: e.currentTarget.dataset.idx, 34 currentTab: e.currentTarget.dataset.idx,
26 - parent_id: e.currentTarget.dataset.id, 35 +
  36 + status:e.currentTarget.dataset.idx+1
  37 +
  38 + })
  39 + this.getbrandlist()
  40 +
  41 + },
  42 +
  43 + //获取品牌主主页
  44 + getbrandlist(){
  45 + let that = this;
  46 + let url = 'index/Brand/index', params = {
  47 + status: that.data.status,
  48 + id: that.data.brandid,
  49 + page:that.data.page
  50 +
  51 +
  52 + }
  53 + app.post(url, params).then((res) => {
  54 + console.log(res);
  55 + that.setData({
  56 + info: res.info,
  57 + brandlist:res.list
  58 + })
  59 +
  60 +
  61 +
  62 + }).catch((err) => {
  63 +
  64 + })
27 65
  66 + },
  67 + //收藏品牌
  68 + collectbrand(e){
  69 + let that = this;
  70 + let id=e.currentTarget.dataset.id
  71 +
  72 + let url = 'index/Common/favorite', params = {
  73 + sort: 2,
  74 + id:id
  75 + }
  76 + app.post(url, params).then((res) => {
  77 + console.log(res);
  78 + wx.showToast({
  79 + title: res,
  80 + icon:'none'
  81 + })
  82 + that.getbrandlist()
  83 +
  84 +
  85 + }).catch((err) => {
  86 +
  87 + })
  88 + },
  89 +//收藏酒品
  90 + collectwine(e){
  91 +
  92 + let that = this;
  93 + let id = e.currentTarget.dataset.id;
  94 + let url = 'index/Common/favorite', params = {
  95 + sort:1,
  96 + id:id
  97 +
  98 + }
  99 + app.post(url, params).then((res) => {
  100 + console.log(res);
  101 + wx.showToast({
  102 + title: res,
  103 + icon:'none'
  104 + })
  105 + that.getbrandlist()
  106 +
  107 +
  108 + }).catch((err) => {
  109 +
  110 + })
  111 +
  112 +
  113 + },
  114 + //品牌详情页
  115 + brandinfo(e){
  116 + let id=e.currentTarget.dataset.id;
  117 + wx.navigateTo({
  118 + url: '/pages/homeblock/brandpage/brandpage?id='+id,
28 }) 119 })
29 }, 120 },
30 /** 121 /**
1 <view class="kindnav"> 1 <view class="kindnav">
2 - <view wx:for="{{navbar}}" data-idx="{{index}}" class="kindnav_item {{currentTab==index ? 'kindactive' : ''}}" wx:key="unique" bindtap="navbarTap" data-id="{{item.id}}">{{item}}  
3 - </view> 2 + <view wx:for="{{navbar}}" data-idx="{{index}}" class="kindnav_item {{currentTab==index ? 'kindactive' : ''}}" wx:key="unique" bindtap="navbarTap" data-id="{{item.id}}">{{item}}
  3 + </view>
4 </view> 4 </view>
5 5
6 -<view class="brandhead">  
7 - <view class="brandleft">  
8 - <view class="brandleftimg">  
9 - <image src="{{url}}aicon_19@2x.png"></image>  
10 - </view>  
11 - <view class="lefttitle">白云边</view>  
12 - <view class="starimg">  
13 - <image src="{{url}}aicon_09x.png"></image>  
14 - </view> 6 +<view class="brandhead" bindtap="brandinfo" data-id="{{info.id}}">
  7 + <view class="brandleft">
  8 + <view class="brandleftimg">
  9 + <image src="{{info.logo}}"></image>
15 </view> 10 </view>
16 - <view class="brandright">  
17 - <view class="rightname">品牌介绍</view>  
18 - <view class="redrow">  
19 - <image src="{{url}}aicon_26@2x.png"></image>  
20 - </view> 11 + <view class="lefttitle">{{info.name}}</view>
  12 + <view class="starimg" catchtap="collectbrand" data-id="{{info.id}}">
  13 + <image src="{{url}}aicon_10x.png" wx:if="{{info.is_favorite==1}}"></image>
  14 + <image src="{{url}}aicon_09x.png" wx:else></image>
  15 +
  16 + </view>
  17 + </view>
  18 + <view class="brandright">
  19 + <view class="rightname">品牌介绍</view>
  20 + <view class="redrow">
  21 + <image src="{{url}}aicon_26@2x.png"></image>
21 </view> 22 </view>
  23 + </view>
22 </view> 24 </view>
23 25
24 -<view class="baiyun">白云边</view> 26 +<view class="baiyun">{{info.name}}</view>
25 27
26 -<view >  
27 - <view class="searchitem">  
28 - <view class="searchitemleft">  
29 - <view class="itemleftimg">  
30 - <image src="{{url}}aicon_11@2x.png"></image>  
31 - </view> 28 +<view>
32 29
33 - <view class="itemiddle">  
34 - <view class="itemidelename">泸州迎宾酒</view>  
35 - <view class="nambottom">  
36 - <text class="namebottomitem">53°</text>  
37 - <text class="namebottomitem">浓香型</text>  
38 - <text class="namebottomitem">53°</text>  
39 - <text class="namebottomitem">53°</text>  
40 - </view>  
41 - </view> 30 +<view class="nodata" wx:if="{{brandlist.length==0}}">暂无数据</view>
  31 +<block wx:else>
  32 + <view class="searchitem" wx:for="{{brandlist}}" wx:key=''>
  33 + <view class="searchitemleft">
  34 + <view class="itemleftimg">
  35 + <image src="{{item.logo}}"></image>
42 </view> 36 </view>
43 37
44 - <view class="starimg">  
45 - <!-- aicon_010x.png -->  
46 -  
47 - <image src="{{url}}aicon_09x.png"></image> 38 + <view class="itemiddle">
  39 + <view class="itemidelename">{{item.name}}</view>
  40 + <view class="nambottom">
  41 + <text class="namebottomitem">{{item.degree_name}}</text>
  42 + <text class="namebottomitem">{{item.odor_name}}</text>
  43 + <text class="namebottomitem">官方价{{item.price}}元</text>
  44 + <text class="namebottomitem">{{item.ml}}</text>
  45 + </view>
48 </view> 46 </view>
  47 + </view>
  48 +
  49 + <view class="starimg" bindtap="collectwine" data-id="{{item.id}}">
49 50
  51 + <image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
  52 + <image src="{{url}}aicon_09x.png" wx:else></image>
50 </view> 53 </view>
51 54
52 -</view> 55 + </view>
  56 +</block>
  57 +</view>
1 // pages/homeblock/brandpage/brandpage.js 1 // pages/homeblock/brandpage/brandpage.js
  2 + var WxParse = require('../../../wxParse/wxParse.js');
2 const app=getApp() 3 const app=getApp()
3 Page({ 4 Page({
4 5
@@ -6,7 +7,10 @@ Page({ @@ -6,7 +7,10 @@ Page({
6 * 页面的初始数据 7 * 页面的初始数据
7 */ 8 */
8 data: { 9 data: {
9 - url:"" 10 + url:"",
  11 + id:'',
  12 + detailinfo:'',
  13 + attr:[]
10 }, 14 },
11 15
12 /** 16 /**
@@ -14,10 +18,105 @@ Page({ @@ -14,10 +18,105 @@ Page({
14 */ 18 */
15 onLoad: function (options) { 19 onLoad: function (options) {
16 this.setData({ 20 this.setData({
17 - url: app.globalData.url 21 + url: app.globalData.url,
  22 + id:options.id
18 }) 23 })
  24 + this.getbrandtail()
19 }, 25 },
  26 + //获取品牌详情页
  27 + getbrandtail(){
  28 + let that = this;
  29 + let url = 'index/Brand/detail', params = {
  30 + id:that.data.id
20 31
  32 + }
  33 + app.post(url, params).then((res) => {
  34 + console.log(res);
  35 + that.setData({
  36 + detailinfo:res.info,
  37 + attr:res.info.attr
  38 +
  39 + })
  40 + let newattr = res.info.attr;
  41 + for (let i = 0; i < newattr.length; i++) {
  42 + newattr[i].show=true
  43 +
  44 + WxParse.wxParse('content' + i, 'html', newattr[i]['content'], that, 5);
  45 +
  46 + if (i === newattr.length - 1) {
  47 +
  48 + WxParse.wxParseTemArray("artileList", 'content', newattr.length, that)
  49 + }
  50 + }
  51 +
  52 + that.setData({
  53 + attr: newattr
  54 + })
  55 +
  56 + }).catch((err) => {
  57 +
  58 + })
  59 + },
  60 + //收藏
  61 + collect(e){
  62 + let id=e.currentTarget.dataset.id;
  63 + let that = this;
  64 + let url = 'index/Common/favorite', params = {
  65 + sort:2,
  66 + id:id
  67 +
  68 + }
  69 + app.post(url, params).then((res) => {
  70 + console.log(res);
  71 + wx.showToast({
  72 + title: res,
  73 + icon:'none'
  74 + })
  75 + that.getbrandtail()
  76 +
  77 +
  78 +
  79 +
  80 + }).catch((err) => {
  81 +
  82 + })
  83 +
  84 + },
  85 + //关注和取消关注
  86 + attention(e){
  87 + let id=e.currentTarget.dataset.id;
  88 + let that = this;
  89 + let url = 'index/Common/concern', params = {
  90 + sort:1,
  91 + id:id
  92 +
  93 + }
  94 + app.post(url, params).then((res) => {
  95 + wx.showToast({
  96 + title: res,
  97 + icon:'none'
  98 + })
  99 + this.getbrandtail()
  100 +
  101 +
  102 + }).catch((err) => {
  103 +
  104 + })
  105 + },
  106 + showinfo(e){
  107 + let idx=e.currentTarget.dataset.idx;
  108 + console.log(idx)
  109 + let newattr = this.data.attr;
  110 + for (var i = 0; i < newattr.length;i++){
  111 + if(i==idx){
  112 + newattr[i].show = !newattr[i].show
  113 + }
  114 + }
  115 + this.setData({
  116 + attr:newattr
  117 + })
  118 + console.log(this.data.attr)
  119 + },
21 /** 120 /**
22 * 生命周期函数--监听页面初次渲染完成 121 * 生命周期函数--监听页面初次渲染完成
23 */ 122 */
  1 +<import src="../../../wxParse/wxParse.wxml" />
1 <view class="brandhead"> 2 <view class="brandhead">
2 <image src="{{url}}aicon_21@2x.png"></image> 3 <image src="{{url}}aicon_21@2x.png"></image>
3 <view class="branditem"> 4 <view class="branditem">
@@ -5,50 +6,52 @@ @@ -5,50 +6,52 @@
5 <view class="branditemleft"> 6 <view class="branditemleft">
6 7
7 <view class="brandlimg"> 8 <view class="brandlimg">
8 - <image src="{{url}}aicon_19@2x.png"></image> 9 + <image src="{{detailinfo.logo}}"></image>
9 </view> 10 </view>
10 11
11 - <view class="brandname">白云边</view> 12 + <view class="brandname">{{detailinfo.name}}</view>
12 </view> 13 </view>
  14 + <view class="branditenright" wx:if="{{detailinfo.is_favorite==1}}" bindtap="collect" data-id="{{detailinfo.id}}">取消收藏</view>
  15 + <view class="branditenright" bindtap="collect" data-id="{{detailinfo.id}}" wx:else>收藏</view>
13 16
14 - <view class="branditenright">收藏</view>  
15 </view> 17 </view>
16 </view> 18 </view>
17 19
18 <view class="brandbottom"> 20 <view class="brandbottom">
19 <view class="brandboleft"> 21 <view class="brandboleft">
20 - <text class="brandtitle">湖北白云边股份股份有限公司</text> 22 + <text class="brandtitle">{{detailinfo.company_name}}</text>
21 <view class="duigou"> 23 <view class="duigou">
22 <image src="{{url}}aicon_20x.png"></image> 24 <image src="{{url}}aicon_20x.png"></image>
23 </view> 25 </view>
24 </view> 26 </view>
25 27
26 - <view class="atten">关注</view> 28 + <view class="atten" wx:if="{{detailinfo.is_concern==1}}" bindtap="attention" data-id="{{detailinfo.company_id}}">取消关注</view>
  29 + <view class="atten" wx:else bindtap="attention" data-id="{{detailinfo.company_id}}">关注</view>
27 30
28 </view> 31 </view>
29 32
30 <view class="brandbox"> 33 <view class="brandbox">
31 - <view class="brandboxitem">  
32 - <view class="boxtop">  
33 - <view class="boxtopleft">  
34 - 品牌简介  
35 - </view>  
36 - <view class="boxright">  
37 - <image src="{{url}}aicon_24x.png"></image>  
38 - </view>  
39 - </view>  
40 -  
41 - <view class="brandtext">  
42 - 湖北白云边集团(以下简称“集团”或“白云边集团”)是一家以酒业为龙头产业的多元化投资控股企业集团,总部位于湖北省武汉市。白云边集团下设7大战略业务单位,包括白酒、食品餐饮、钢铁制造、置业投资、酒店旅游、物流商贸、文化传播等。白云边集团的多元化业务具有良好的产业基础和市场竞争优势,其中白酒已建立行业领先地位。截止2017年,白云边集团总资产达80余亿元。  
43 - </view> 34 + <view class="brandboxitem" wx:for="{{attr}}" wx:key='' wx:for-index="idxs">
  35 + <view class="boxtop">
  36 + <view class="boxtopleft">
  37 + {{item.name}}
  38 + </view>
  39 + <view class="boxright" bindtap="showinfo" data-idx="{{idxs}}">
  40 + <image src="{{url}}aicon_53x.png" wx:if="{{item.show}}"></image>
  41 + <image src="{{url}}aicon_52x.png" wx:else></image>
  42 + </view>
  43 + </view>
44 44
45 - <view class="brandimg">  
46 - <image src="{{url}}aicon_23@2x.png"></image>  
47 - </view>  
48 - 45 + <view class="brandtext" wx:if="{{item.show}}">
  46 + <block wx:for="{{artileList}}" wx:for-item="item" wx:for-index="idx" wx:key=''>
  47 + <block wx:if="{{idxs==idx}}">
  48 + <template is="wxParse" data="{{wxParseData:item}}" />
  49 + </block>
  50 + </block>
49 </view> 51 </view>
  52 + </view>
50 53
51 - <view class="brandboxitem"> 54 + <!-- <view class="brandboxitem">
52 <view class="boxtop"> 55 <view class="boxtop">
53 <view class="boxtopleft"> 56 <view class="boxtopleft">
54 品牌文化 57 品牌文化
@@ -63,6 +66,6 @@ @@ -63,6 +66,6 @@
63 <image src="{{url}}aicon_23@2x.png"></image> 66 <image src="{{url}}aicon_23@2x.png"></image>
64 </view> 67 </view>
65 68
66 - </view> 69 + </view> -->
67 70
68 </view> 71 </view>
@@ -35,7 +35,7 @@ image{ @@ -35,7 +35,7 @@ image{
35 align-items: center 35 align-items: center
36 } 36 }
37 .branditenright{ 37 .branditenright{
38 - width:100rpx; 38 + padding: 0 20rpx;
39 height:50rpx; 39 height:50rpx;
40 background:rgba(255,255,255,1); 40 background:rgba(255,255,255,1);
41 border-radius:2px; 41 border-radius:2px;
1 // pages/homeblock/companyintro/companyintro.js 1 // pages/homeblock/companyintro/companyintro.js
  2 +var WxParse = require('../../../wxParse/wxParse.js');
2 const app=getApp() 3 const app=getApp()
3 Page({ 4 Page({
4 5
@@ -15,6 +16,9 @@ Page({ @@ -15,6 +16,9 @@ Page({
15 interval: 2000, 16 interval: 2000,
16 duration: 1000, 17 duration: 1000,
17 currentSwiper: 0, 18 currentSwiper: 0,
  19 + id:'',
  20 + attr:[],
  21 + companyinfo:''
18 22
19 }, 23 },
20 24
@@ -23,14 +27,91 @@ Page({ @@ -23,14 +27,91 @@ Page({
23 */ 27 */
24 onLoad: function (options) { 28 onLoad: function (options) {
25 this.setData({ 29 this.setData({
26 - url: app.globalData.url 30 + url: app.globalData.url,
  31 + id:options.id
27 }) 32 })
  33 + this.getcompanydetail()
28 }, 34 },
29 swiperChange: function (e) { 35 swiperChange: function (e) {
30 this.setData({ 36 this.setData({
31 currentSwiper: e.detail.current 37 currentSwiper: e.detail.current
32 }) 38 })
33 }, 39 },
  40 + //获取企业详情
  41 + getcompanydetail(){
  42 + let that = this;
  43 + let url = 'index/Company/detail', params = {
  44 + id:that.data.id
  45 +
  46 + }
  47 + app.post(url, params).then((res) => {
  48 + console.log(res);
  49 + that.setData({
  50 + companyinfo: res,
  51 + imgUrls:res.banner,
  52 + attr: res.attr
  53 +
  54 + })
  55 +
  56 + let newattr = res.attr;
  57 + for (let i = 0; i < newattr.length; i++) {
  58 + newattr[i].show = true
  59 +
  60 + WxParse.wxParse('content' + i, 'html', newattr[i]['content'], that, 5);
  61 +
  62 + if (i === newattr.length - 1) {
  63 +
  64 + WxParse.wxParseTemArray("artileList", 'content', newattr.length, that)
  65 + }
  66 + }
  67 +
  68 + that.setData({
  69 + attr: newattr
  70 + })
  71 +
  72 +
  73 +
  74 +
  75 + }).catch((err) => {
  76 +
  77 + })
  78 + },
  79 +
  80 + showinfo(e){
  81 + let idx = e.currentTarget.dataset.idx;
  82 + console.log(idx)
  83 + let newattr = this.data.attr;
  84 + for (var i = 0; i < newattr.length; i++) {
  85 + if (i == idx) {
  86 + newattr[i].show = !newattr[i].show
  87 + }
  88 + }
  89 + this.setData({
  90 + attr: newattr
  91 + })
  92 + },
  93 + //关注和取消关注
  94 + attention(e){
  95 + let that = this;
  96 + let id=e.currentTarget.dataset.id;
  97 + let url = 'index/Common/concern', params = {
  98 + sort:1,
  99 + id:id
  100 +
  101 + }
  102 + app.post(url, params).then((res) => {
  103 + console.log(res);
  104 + wx.showToast({
  105 + title: res,
  106 + icon:'none'
  107 + })
  108 + that.getcompanydetail()
  109 +
  110 +
  111 + }).catch((err) => {
  112 +
  113 + })
  114 + },
34 /** 115 /**
35 * 生命周期函数--监听页面初次渲染完成 116 * 生命周期函数--监听页面初次渲染完成
36 */ 117 */
1 - 1 +<import src="../../../wxParse/wxParse.wxml" />
2 2
3 <view class="brandbottom"> 3 <view class="brandbottom">
4 <view class="brandboleft"> 4 <view class="brandboleft">
5 - <text class="brandtitle">湖北白云边股份股份有限公司</text> 5 + <text class="brandtitle">{{companyinfo.name}}</text>
6 <view class="duigou"> 6 <view class="duigou">
7 <image src="{{url}}aicon_20x.png"></image> 7 <image src="{{url}}aicon_20x.png"></image>
8 </view> 8 </view>
9 </view> 9 </view>
10 10
11 - <view class="atten">关注</view> 11 + <view class="atten" wx:if="{{companyinfo.is_concern==0}}" bindtap="attention" data-id="{{companyinfo.id}}">关注</view>
  12 + <view class="atten" wx:else bindtap="attention" data-id="{{companyinfo.id}}">取消关注</view>
12 13
13 </view> 14 </view>
14 - <view class="swiper_image">  
15 - <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" class="swiper_item_img" bindchange="swiperChange">  
16 - <block wx:for="{{imgUrls}}" wx:key="doct">  
17 - <swiper-item style="border-radius:10px;">  
18 - <image src="{{item}}" data-index='{{index}}' class="slide-image" bindtap='viewImg' width="355" height="150" />  
19 - </swiper-item>  
20 - </block>  
21 - </swiper>  
22 -  
23 - <view class="dots">  
24 - <block wx:for="{{imgUrls}}" wx:key="">  
25 - <view class="dot{{index == currentSwiper ? ' active' : ''}}"></view>  
26 - </block>  
27 - </view> 15 +<view class="swiper_image">
  16 + <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" class="swiper_item_img" bindchange="swiperChange">
  17 + <block wx:for="{{imgUrls}}" wx:key="doct">
  18 + <swiper-item style="border-radius:10px;">
  19 + <image src="{{item.url}}" data-index='{{index}}' class="slide-image" bindtap='viewImg' width="355" height="150" />
  20 + </swiper-item>
  21 + </block>
  22 + </swiper>
28 23
  24 + <view class="dots">
  25 + <block wx:for="{{imgUrls}}" wx:key="">
  26 + <view class="dot{{index == currentSwiper ? ' active' : ''}}"></view>
  27 + </block>
29 </view> 28 </view>
30 29
31 -<view class="brandbox">  
32 - <view class="brandboxitem">  
33 - <view class="boxtop">  
34 - <view class="boxtopleft">  
35 - 品牌简介  
36 - </view>  
37 - <view class="boxright">  
38 - <image src="{{url}}aicon_24x.png"></image>  
39 - </view>  
40 - </view> 30 +</view>
41 31
42 - <view class="brandtext">  
43 - 湖北白云边集团(以下简称“集团”或“白云边集团”)是一家以酒业为龙头产业的多元化投资控股企业集团,总部位于湖北省武汉市。白云边集团下设7大战略业务单位,包括白酒、食品餐饮、钢铁制造、置业投资、酒店旅游、物流商贸、文化传播等。白云边集团的多元化业务具有良好的产业基础和市场竞争优势,其中白酒已建立行业领先地位。截止2017年,白云边集团总资产达80余亿元。  
44 - </view> 32 +<view class="brandbox">
  33 + <view class="brandboxitem" wx:for="{{attr}}" wx:key='' wx:for-index="idxs">
  34 + <view class="boxtop">
  35 + <view class="boxtopleft">
  36 + {{item.name}}
  37 + </view>
  38 + <view class="boxright" bindtap="showinfo" data-idx="{{idxs}}">
  39 + <image src="{{url}}aicon_53x.png" wx:if="{{item.show}}"></image>
  40 + <image src="{{url}}aicon_52x.png" wx:else></image>
  41 + </view>
  42 + </view>
45 43
46 - <view class="brandimg">  
47 - <image src="{{url}}aicon_23@2x.png"></image>  
48 - </view>  
49 - 44 + <view class="brandtext" wx:if="{{item.show}}">
  45 + <block wx:for="{{artileList}}" wx:for-item="item" wx:for-index="idx" wx:key=''>
  46 + <block wx:if="{{idxs==idx}}">
  47 + <template is="wxParse" data="{{wxParseData:item}}" />
  48 + </block>
  49 + </block>
50 </view> 50 </view>
51 51
52 - <view class="brandboxitem"> 52 +
  53 +
  54 + </view>
  55 +
  56 + <!-- <view class="brandboxitem">
53 <view class="boxtop"> 57 <view class="boxtop">
54 <view class="boxtopleft"> 58 <view class="boxtopleft">
55 品牌文化 59 品牌文化
@@ -64,6 +68,6 @@ @@ -64,6 +68,6 @@
64 <image src="{{url}}aicon_23@2x.png"></image> 68 <image src="{{url}}aicon_23@2x.png"></image>
65 </view> 69 </view>
66 70
67 - </view> 71 + </view> -->
68 72
69 </view> 73 </view>
1 // pages/homeblock/evalute/evalute.js 1 // pages/homeblock/evalute/evalute.js
2 -const app=getApp() 2 +const app = getApp()
3 Page({ 3 Page({
4 4
5 /** 5 /**
6 * 页面的初始数据 6 * 页面的初始数据
7 */ 7 */
8 data: { 8 data: {
9 - url:'',  
10 - star1:0,  
11 - sepic:false 9 + url: '',
  10 + star1: 0,
  11 + sepic: true,
  12 + id: '',
  13 + biaoqian: false,
  14 + tablist: [],
  15 + labelname: '',
  16 + images: [],
  17 + videoimg: '',
  18 + chuanimages:[],
  19 + chuanvideoimg:'',
  20 +
  21 + currentCity: '',
  22 + content: '',
  23 + current: '',
  24 + labelid: []
  25 +
12 26
13 }, 27 },
14 28
15 /** 29 /**
16 * 生命周期函数--监听页面加载 30 * 生命周期函数--监听页面加载
17 */ 31 */
18 - onLoad: function (options) { 32 + onLoad: function(options) {
  33 + this.setData({
  34 + url: app.globalData.url,
  35 + id: options.wineid
  36 + })
  37 +
  38 + this.gettablist();
  39 + this.getcity()
  40 + },
  41 +
  42 +
  43 + //获取用户当前位置
  44 + getcity() {
  45 + let that = this;
  46 + wx.getLocation({
  47 + type: 'gcj02',
  48 + success: function(res) {
  49 + // 经纬度
  50 + var latitude = res.latitude
  51 + var longitude = res.longitude
  52 +
  53 + var aK = that.data.aK
  54 + wx.request({
  55 + url: 'https://api.map.baidu.com/geocoder/v2/?ak=y8jPDTMIuAnaVscUztce1RKfNx8v5sok&location=' + latitude + ',' + longitude + '&output=json',
  56 + data: {},
  57 + header: {
  58 + 'content-type': 'application/json'
  59 + },
  60 + success: function(res) {
  61 + console.log('1234567890', res)
  62 + var province = res.data.result.addressComponent.province;
  63 + let district = res.data.result.addressComponent.district
  64 + that.setData({
  65 + currentCity: province
  66 + })
  67 + wx.setStorageSync('city', province)
  68 + wx.request({
  69 + // url: 'xxx' + city,
  70 + // data: {},
  71 + // header: {
  72 + // 'content-type': 'application/json'
  73 + // },
  74 + // success: function (res) {
  75 + // that.setData({
  76 + // county: res.data,
  77 + // })
  78 + // },
  79 + })
  80 + }
  81 + })
  82 +
  83 + },
  84 + fail: function() {
  85 + wx.showToast({
  86 + title: '授权失败,请打开GPS重新进入页面授权',
  87 + icon: 'none',
  88 + duration: 2000
  89 + })
  90 + }
  91 + })
  92 + },
  93 + //获取标签列表
  94 + gettablist() {
  95 + let that = this;
  96 + let url = 'index/Wine/tag_list',
  97 + params = {
  98 +
  99 +
  100 + }
  101 + app.post(url, params).then((res) => {
  102 + console.log(res);
  103 + that.setData({
  104 + tablist: res.list
  105 + })
  106 + let newtablist = that.data.tablist;
  107 + for (var obj of newtablist) {
  108 + obj.sel = false
  109 + }
  110 + that.setData({
  111 + tablist: newtablist
  112 + })
  113 +
  114 +
  115 +
  116 +
  117 + }).catch((err) => {
  118 +
  119 + })
  120 + },
  121 + //输入标签
  122 + enterlabel(e) {
  123 + this.setData({
  124 + labelname: e.detail.value
  125 + })
  126 + },
  127 + //选择标签
  128 + selectlabel(e) {
  129 + let idx = e.currentTarget.dataset.idx;
  130 +
  131 + let id = e.currentTarget.dataset.id;
  132 + let newtablist=this.data.tablist;
  133 + for (var obj of newtablist){
  134 +
  135 + if (id==obj.id){
  136 + obj.sel = !obj.sel;
  137 +
  138 +
  139 + if (obj.sel == true) {
  140 + this.data.labelid.push(obj.id)
  141 + } else if (obj.sel==false) {
  142 + let newlabelid = this.data.labelid;
  143 +
  144 + for (var i = 0; i < newlabelid.length;i++){
  145 + if(newlabelid[i]==obj.id){
  146 + newlabelid.splice(i, 1);
  147 + }
  148 + }
  149 +
  150 +
  151 + this.setData({
  152 + labelid: newlabelid
  153 + })
  154 + }
  155 +
  156 + if (this.data.labelid.length>3){
  157 + wx.showToast({
  158 + title: '最多选择三个标签',
  159 + icon:'none'
  160 + })
  161 +
  162 + let newlabelid = this.data.labelid;
  163 +
  164 + for (var i = 0; i < newlabelid.length; i++) {
  165 + if (newlabelid[i] == obj.id) {
  166 + newlabelid.splice(i, 1);
  167 + }
  168 + }
  169 + obj.sel=false
  170 + }
  171 + }
  172 + }
  173 +
  174 + console.log(this.data.labelid)
  175 + this.setData({
  176 + tablist: newtablist
  177 + })
  178 + },
  179 +
  180 + sureadd() {
  181 +
  182 + let that = this;
  183 + if (that.data.labelname.length > 10) {
  184 + wx.showToast({
  185 + title: '请输入10以下的字符',
  186 + icon: 'none'
  187 + })
  188 + } else {
  189 + let url = 'index/Wine/create_tag',
  190 + params = {
  191 + name: that.data.labelname
  192 +
  193 + }
  194 + app.post(url, params).then((res) => {
  195 + console.log(res);
  196 + wx.showToast({
  197 + title: '添加成功',
  198 + icon: 'none'
  199 + })
  200 + that.setData({
  201 + biaoqian: false
  202 + })
  203 +
  204 +
  205 + that.gettablist()
  206 +
  207 + }).catch((err) => {
  208 + console.log(err)
  209 + wx.showToast({
  210 + title: err.data.msg,
  211 + icon:"none"
  212 + })
  213 + })
  214 + }
  215 +
  216 + },
  217 + hideregister() {
  218 + this.setData({
  219 + biaoqian: false
  220 + })
  221 + },
  222 +
  223 + addnewlabel() {
  224 + this.setData({
  225 + biaoqian: true
  226 + })
  227 + },
  228 + cancel() {
19 this.setData({ 229 this.setData({
20 - url: app.globalData.url 230 + biaoqian: false
21 }) 231 })
22 }, 232 },
23 - star(e){ 233 + star(e) {
24 this.setData({ 234 this.setData({
25 - star1:e.currentTarget.dataset.id 235 + star1: e.currentTarget.dataset.id
26 }) 236 })
27 }, 237 },
28 - se(){ 238 + se() {
29 this.setData({ 239 this.setData({
30 sepic: !this.data.sepic 240 sepic: !this.data.sepic
31 }) 241 })
32 }, 242 },
  243 +
  244 +
  245 +
  246 + //添加图片
  247 + chooseImage() {
  248 + let that = this;
  249 + wx.chooseImage({
  250 + count: 1,
  251 + sizeType: ['original', 'compressed'],
  252 + success: function(res) {
  253 + console.log(res)
  254 + app.upload('image', res.tempFilePaths[0]).then((res) => {
  255 +
  256 + console.log('上传文件' + res);
  257 + let data = JSON.parse(JSON.stringify(res))
  258 + console.log(data)
  259 + let arr = that.data.images;
  260 + let chuanarr=that.data.chuanimages;
  261 + chuanarr.push(data.local_url)
  262 + arr.push(data.url)
  263 + that.setData({
  264 + images: arr,
  265 + chuanimages:chuanarr
  266 + })
  267 +
  268 + console.log(that.data.chuanimages)
  269 + }).catch((err) => {
  270 + console.log(err)
  271 + })
  272 + },
  273 + fail: function(res) {}
  274 + })
  275 + },
  276 + //删除照片
  277 + delimg(e) {
  278 + let idx = e.currentTarget.dataset.index;
  279 + let newimages = this.data.images;
  280 + for (var i = 0; i < newimages.length; i++) {
  281 + if (i == idx) {
  282 + newimages.splice(i, 1)
  283 + }
  284 + }
  285 +
  286 + let newchuanimages=this.data.chuanimages;
  287 + for(var i=0;i<newchuanimages.length;i++){
  288 + if (i == idx) {
  289 + newchuanimages.splice(i, 1)
  290 + }
  291 + }
  292 +
  293 + this.setData({
  294 + images: newimages,
  295 + chuanimages:newchuanimages
  296 + })
  297 +
  298 + },
  299 +
  300 + //上传视频
  301 + choosevideo() {
  302 + let that = this;
  303 + wx.chooseVideo({
  304 + sourceType: ['album', 'camera'],
  305 + maxDuration: 60,
  306 + camera: 'back',
  307 + success(res) {
  308 + console.log(res.tempFilePath);
  309 + that.setData({
  310 + videoimg: res.tempFilePath,
  311 + })
  312 +
  313 + // app.upload('video', res.tempFilePath).then((res) => {
  314 + // let videos = that.data.videos;
  315 + // videos.push(res.url);
  316 + // that.setData({
  317 + // videos: videos
  318 + // })
  319 + // }).catch((err) => {
  320 + // console.log(err)
  321 + // })
  322 +
  323 + let file = res.tempFilePath
  324 + that.upload(file)
  325 + }
  326 + })
  327 + },
  328 +
  329 + upload(file) {
  330 +
  331 + let that=this;
  332 +
  333 + let url = 'https://winesbook.cn/api/user/upload/one';
  334 + let head = {
  335 + 'XX-Token': wx.getStorageSync('token'),
  336 + 'XX-Device-Type': 'wxapp'
  337 + }
  338 + // let typename = {
  339 + // filetype: filetype
  340 + // }
  341 + wx.uploadFile({
  342 + url: url, //仅为示例,非真实的接口地址
  343 + filePath: file,
  344 + name: 'file',
  345 + header: head,
  346 + formData: {
  347 + filetype: 'video'
  348 + },
  349 + success: function(res) {
  350 + console.log('上传文件后', JSON.parse(res.data))
  351 +
  352 + let data = JSON.parse(res.data)
  353 +
  354 + that.setData({
  355 + chuanvideoimg: data.data.local_url
  356 + })
  357 + // let temdata = JSON.parse(res.data);
  358 + // let urlobj = {
  359 + // url: temdata.data.preview_url
  360 + // }
  361 + // resolve(urlobj);
  362 + // wx.hideNavigationBarLoading();
  363 + // wx.hideLoading();
  364 + },
  365 + fail: function(res) {
  366 + reject('网络出错');
  367 + wx.hideNavigationBarLoading()
  368 + wx.hideLoading()
  369 + },
  370 + complete: () => {
  371 + wx.hideNavigationBarLoading()
  372 + wx.hideLoading()
  373 + },
  374 + })
  375 +
  376 + },
  377 +
  378 + // 删除音频
  379 + delvideo() {
  380 + this.setData({
  381 + videoimg: '',
  382 + chuanvideoimg:''
  383 + })
  384 + },
  385 + //输入评论
  386 + entercontent(e) {
  387 + this.setData({
  388 + content: e.detail.value
  389 + })
  390 + },
  391 +
  392 + //发布
  393 + publish() {
  394 + let that = this;
  395 + let newfiles = [];
  396 + let newimages = that.data.chuanimages;
  397 + if (that.data.chuanvideoimg != '') {
  398 + newfiles.push(that.data.chuanvideoimg)
  399 + }
  400 +
  401 + if (newimages.length != 0) {
  402 + for (var i = 0; i < newimages.length; i++) {
  403 + newfiles.push(newimages[i])
  404 + }
  405 + }
  406 + newfiles = newfiles.join(",");
  407 + console.log(newfiles)
  408 + let newlabelid=that.data.labelid;
  409 +
  410 + newlabelid= newlabelid.join(",")
  411 + console.log(newlabelid)
  412 +
  413 +
  414 + let url = 'index/Wine/create_comment',
  415 + params = {
  416 + wine_id: that.data.id,
  417 + score: that.data.star1,
  418 + content: that.data.content,
  419 + files: newfiles,
  420 + position: that.data.currentCity,
  421 + tags: newlabelid
  422 +
  423 + }
  424 + app.post(url, params).then((res) => {
  425 + console.log(res);
  426 +
  427 + wx.showToast({
  428 + title: '发布成功',
  429 + icon:'none'
  430 + })
  431 +
  432 + setTimeout(function(){
  433 + wx.navigateBack({
  434 + checked:true
  435 + })
  436 + },1500)
  437 +
  438 +
  439 +
  440 + }).catch((err) => {
  441 +
  442 + })
  443 + },
  444 +
33 /** 445 /**
34 * 生命周期函数--监听页面初次渲染完成 446 * 生命周期函数--监听页面初次渲染完成
35 */ 447 */
36 - onReady: function () { 448 + onReady: function() {
37 449
38 }, 450 },
39 451
40 /** 452 /**
41 * 生命周期函数--监听页面显示 453 * 生命周期函数--监听页面显示
42 */ 454 */
43 - onShow: function () { 455 + onShow: function() {
44 456
45 }, 457 },
46 458
47 /** 459 /**
48 * 生命周期函数--监听页面隐藏 460 * 生命周期函数--监听页面隐藏
49 */ 461 */
50 - onHide: function () { 462 + onHide: function() {
51 463
52 }, 464 },
53 465
54 /** 466 /**
55 * 生命周期函数--监听页面卸载 467 * 生命周期函数--监听页面卸载
56 */ 468 */
57 - onUnload: function () { 469 + onUnload: function() {
58 470
59 }, 471 },
60 472
61 /** 473 /**
62 * 页面相关事件处理函数--监听用户下拉动作 474 * 页面相关事件处理函数--监听用户下拉动作
63 */ 475 */
64 - onPullDownRefresh: function () { 476 + onPullDownRefresh: function() {
65 477
66 }, 478 },
67 479
68 /** 480 /**
69 * 页面上拉触底事件的处理函数 481 * 页面上拉触底事件的处理函数
70 */ 482 */
71 - onReachBottom: function () { 483 + onReachBottom: function() {
72 484
73 }, 485 },
74 486
75 /** 487 /**
76 * 用户点击右上角分享 488 * 用户点击右上角分享
77 */ 489 */
78 - onShareAppMessage: function () { 490 + onShareAppMessage: function() {
79 491
80 } 492 }
81 }) 493 })
  1 +<!-- 新增标签 -->
  2 +<view class="register" wx:if="{{biaoqian}}" bindtap="hideregister">
  3 + <view class="registerwrap" catchtap='tab'>
  4 + <view class="enterbiao">输入标签名</view>
  5 + <view class="enterword">
  6 + <input placeholder='标签名10个汉字(20个字符)以内' placeholder-class='enter' bindinput="enterlabel" />
  7 + </view>
  8 +
  9 + <view class="tabottom">
  10 + <view class="cancel" catchtap='cancel'>取消</view>
  11 + <view class="sure" bindtap="sureadd">确定</view>
  12 + </view>
  13 + </view>
  14 +</view>
  15 +
1 <view star> 16 <view star>
2 <view class="starname">滑动星星评分</view> 17 <view class="starname">滑动星星评分</view>
3 <view class="starlist"> 18 <view class="starlist">
@@ -30,22 +45,15 @@ @@ -30,22 +45,15 @@
30 选择标签 45 选择标签
31 </view> 46 </view>
32 <view class="biaoqianright" bindtap="se"> 47 <view class="biaoqianright" bindtap="se">
33 - <image src="{{sepic==false?'http://winesbook.cn/static/images_mini/aicon_53x.png':'http://winesbook.cn/static/images_mini/aicon_52x.png'}}"></image> 48 + <image src="{{sepic==true?'http://winesbook.cn/static/images_mini/aicon_53x.png':'http://winesbook.cn/static/images_mini/aicon_52x.png'}}"></image>
34 </view> 49 </view>
35 </view> 50 </view>
36 51
37 -<view class="showpic">  
38 - <view class="showpicitem">婚宴</view>  
39 - <view class="showpicitem">婚宴</view>  
40 - <view class="showpicitem">婚宴</view>  
41 - <view class="showpicitem">婚宴</view>  
42 - <view class="showpicitem">婚宴</view>  
43 - <view class="showpicitem">婚宴</view>  
44 - <view class="showpicitem">婚宴</view>  
45 - <view class="showpicitem">婚宴</view>  
46 - <view class="showpicitem">婚宴</view>  
47 -  
48 - <view class="addnew"> 52 +<view class="showpic" wx:if="{{sepic}}">
  53 + <view class="showpicitem {{item.sel==true?'labelactive':''}}" wx:for="{{tablist}}" wx:key='' catchtap='selectlabel' data-id="{{item.id}}" data-idx="{{index}}">{{item.name}}</view>
  54 +
  55 +
  56 + <view class="addnew" bindtap="addnewlabel">
49 <view class="jia"> 57 <view class="jia">
50 <image src="/img/aicon66.png"></image> 58 <image src="/img/aicon66.png"></image>
51 </view> 59 </view>
@@ -58,54 +66,57 @@ @@ -58,54 +66,57 @@
58 66
59 <view class="imgbox"> 67 <view class="imgbox">
60 68
61 - <view class="imgboxite">  
62 - <image src="{{url}}/aicon_49@2x.png"></image> 69 + <block wx:for="{{images}}" wx:key="">
  70 + <view class="imgboxite">
  71 + <image src="{{item}}"></image>
63 72
64 - <view class="cha"> 73 + <view class="cha" bindtap="delimg" data-index="{{index}}">
65 <image src="{{url}}/aicon_54x.png"></image> 74 <image src="{{url}}/aicon_54x.png"></image>
  75 + </view>
66 </view> 76 </view>
67 - </view>  
68 - <view class="imgboxite">  
69 - <image src="{{url}}/aicon_49@2x.png"></image> 77 + </block>
70 78
71 - <view class="cha">  
72 - <image src="{{url}}/aicon_54x.png"></image>  
73 - </view>  
74 - </view>  
75 - <view class="imgboxite">  
76 - <image src="{{url}}/aicon_49@2x.png"></image> 79 + <block wx:if="{{videoimg!=''}}" wx:key="">
  80 + <view class="imgboxite">
  81 + <video src="{{videoimg}}"></video>
77 82
78 - <view class="cha"> 83 + <view class="cha" bindtap="delvideo" data-index="{{index}}">
79 <image src="{{url}}/aicon_54x.png"></image> 84 <image src="{{url}}/aicon_54x.png"></image>
  85 + </view>
80 </view> 86 </view>
81 - </view>  
82 - <view class="imgboxite">  
83 - <image src="{{url}}/aicon_49@2x.png"></image> 87 + </block>
84 88
85 - <view class="cha">  
86 - <image src="{{url}}/aicon_54x.png"></image>  
87 - </view> 89 + <block wx:if="{{videoimg!=''}}">
  90 + <view class="addimg" bindtap="chooseImage" wx:if="{{images.length<5}}">
  91 + <image src="{{url}}/aicon_55x.png"></image>
88 </view> 92 </view>
89 -  
90 - <view class="addimg">  
91 - <image src="{{url}}/aicon_55x.png"></image> 93 + </block>
  94 + <block wx:else>
  95 + <view class="addimg" bindtap="chooseImage" wx:if="{{images.length<6}}">
  96 + <image src="{{url}}/aicon_55x.png"></image>
  97 + </view>
  98 + </block>
  99 + <block wx:if="{{videoimg==''}}">
  100 + <view class="addimg" bindtap="choosevideo" wx:if="{{images.length<6}}">
  101 + <image src="/img/cicon17@2x.png"></image>
92 </view> 102 </view>
  103 + </block>
93 104
94 105
95 </view> 106 </view>
96 107
97 <view class="entersay saybox"> 108 <view class="entersay saybox">
98 - <textarea placeholder='这酒怎么样我来说一说' placeholder-class='entersay'/> 109 + <textarea placeholder='这酒怎么样我来说一说' placeholder-class='entersay' bindinput="entercontent"/>
99 </view> 110 </view>
100 111
101 <view class="saybottom"> 112 <view class="saybottom">
102 - <view class="sayleft">  
103 - <view class="sayimg">  
104 - <image src="{{url}}/aicon_56x.png"></image>  
105 - </view>  
106 -  
107 - <view class="leftword">所在位置</view> 113 + <view class="sayleft">
  114 + <view class="sayimg">
  115 + <image src="{{url}}/aicon_56x.png"></image>
108 </view> 116 </view>
109 117
110 - <view class="sayright">发布</view> 118 + <view class="leftword">{{currentCity}}</view>
  119 + </view>
  120 +
  121 + <view class="sayright" bindtap="publish">发布</view>
111 </view> 122 </view>
@@ -47,6 +47,11 @@ @@ -47,6 +47,11 @@
47 color:#1A1A1A; 47 color:#1A1A1A;
48 font-size: 24rpx; 48 font-size: 24rpx;
49 text-align: center; 49 text-align: center;
  50 + background: #F2F2F2;
  51 + margin-left:10rpx;
  52 + margin-top:10rpx;
  53 + border-radius:10rpx;
  54 + border:1rpx solid transparent
50 55
51 } 56 }
52 .addnew{ 57 .addnew{
@@ -57,6 +62,8 @@ @@ -57,6 +62,8 @@
57 border:1rpx solid rgba(232,24,37,1); 62 border:1rpx solid rgba(232,24,37,1);
58 border-radius:5rpx; 63 border-radius:5rpx;
59 justify-content: center; 64 justify-content: center;
  65 + margin-left:10rpx;
  66 + margin-top:10rpx;
60 } 67 }
61 .jia{ 68 .jia{
62 width:15rpx; 69 width:15rpx;
@@ -74,6 +81,10 @@ @@ -74,6 +81,10 @@
74 position: relative; 81 position: relative;
75 margin-top:20rpx; 82 margin-top:20rpx;
76 } 83 }
  84 +.imgboxite video{
  85 + width:210rpx;
  86 + height:210rpx;
  87 +}
77 .imgboxite{ 88 .imgboxite{
78 margin-left:28rpx; 89 margin-left:28rpx;
79 } 90 }
@@ -132,4 +143,74 @@ display:flex; @@ -132,4 +143,74 @@ display:flex;
132 .sayright{ 143 .sayright{
133 color:#E81825; 144 color:#E81825;
134 font-size: 32rpx 145 font-size: 32rpx
  146 +}
  147 +.register{
  148 + top:0;
  149 +}
  150 +.registerwrap{
  151 + width:610rpx;
  152 + height:350rpx;
  153 + background: #ffffff;
  154 +
  155 + position: absolute;
  156 + z-index: 99;
  157 + top:50%;
  158 + left:50%;
  159 + transform: translate(-50%,-50%);
  160 + padding: 45rpx 45rpx 0;
  161 + box-sizing: border-box
  162 +
  163 +}
  164 +.enterbiao{
  165 + color:#666666;
  166 + font-size: 34rpx;
  167 + text-align: center;
  168 + margin-top:22rpx;
  169 +
  170 +}
  171 +.enterword{
  172 + width:520rpx;
  173 + height:80rpx;
  174 + color:#999999;
  175 + font-size: 26rpx;
  176 + text-align: center;
  177 + margin-top:25rpx;
  178 +}
  179 +.enterword input{
  180 + width:520rpx;
  181 + height:80rpx;
  182 + text-align: center
  183 +}
  184 +.enter{
  185 + color:#999999;
  186 + font-size: 26rpx
  187 +}
  188 +.tabottom{
  189 + height:90rpx;
  190 + border-top:1rpx solid #f5f5f5;
  191 + display:flex;
  192 + align-items: center;
  193 + justify-content: space-between;
  194 + margin-top:45rpx;
  195 +}
  196 +.cancel{
  197 + width:50%;
  198 + height:90rpx;
  199 + line-height: 90rpx;
  200 + text-align: center;
  201 + border-right:1rpx solid #f5f5f5;
  202 + color:#999999;
  203 + font-size: 32rpx;
  204 +}
  205 +.sure{
  206 + width:50%;
  207 + text-align: center;
  208 + height:90rpx;
  209 + line-height: 90rpx;
  210 +
  211 + color:#E81825;
  212 + font-size: 32rpx;
  213 +}
  214 +.labelactive{
  215 + border:1rpx solid #E81825
135 } 216 }
@@ -7,6 +7,11 @@ Page({ @@ -7,6 +7,11 @@ Page({
7 */ 7 */
8 data: { 8 data: {
9 url: '', 9 url: '',
  10 + id:'',
  11 + page:1,
  12 + hot_tag:[],
  13 + list:[],
  14 + statistics:''
10 }, 15 },
11 16
12 /** 17 /**
@@ -14,10 +19,115 @@ Page({ @@ -14,10 +19,115 @@ Page({
14 */ 19 */
15 onLoad: function (options) { 20 onLoad: function (options) {
16 this.setData({ 21 this.setData({
17 - url: app.globalData.url 22 + url: app.globalData.url,
  23 + id:options.wineid
  24 + })
  25 +
  26 +
  27 + },
  28 + formatDate(datetime) {
  29 + // 获取年月日时分秒值 slice(-2)过滤掉大于10日期前面的0
  30 + var date = new Date(datetime * 1000)
  31 + var Y = date.getFullYear();
  32 + var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
  33 + var D = (date.getDate() + 1 < 10 ? '0' + (date.getDate()) : date.getDate())
  34 + var h = date.getHours() + ':';
  35 + var m = date.getMinutes() + ':';
  36 + var s = date.getSeconds();
  37 + // 拼接
  38 + var result = Y + "-" + M + "-" + D
  39 + console.log(result)
  40 + this.setData({
  41 + date: result
  42 + })
  43 + // 返回
  44 + return result;
  45 + },
  46 +
  47 + //获取评论列表
  48 + getcommentlist(){
  49 + let that = this;
  50 + let url = 'index/Wine/comment_list', params = {
  51 + wine_id:that.data.id,
  52 + page:that.data.page
  53 +
  54 + }
  55 + app.post(url, params).then((res) => {
  56 + console.log(res);
  57 + that.setData({
  58 + hot_tag: res.hot_tag,
  59 + list: res.list,
  60 + statistics: res.statistics,
  61 + headscore: res.statistics.score*10
  62 + })
  63 +
  64 + let newlist=res.list;
  65 + for (var obj of newlist){
  66 + obj.score=obj.score*10;
  67 + var date = new Date(obj.create_time * 1000)
  68 + var Y = date.getFullYear();
  69 + var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
  70 + var D = (date.getDate() + 1 < 10 ? '0' + (date.getDate()) : date.getDate())
  71 + var h = date.getHours() + ':';
  72 + var m = date.getMinutes() + ':';
  73 + var s = date.getSeconds();
  74 + // 拼接
  75 + var result = Y + "年" + M + "月" + D+'日'
  76 + obj.create_time=result
  77 +
  78 + }
  79 +
  80 + that.setData({
  81 + list:newlist
  82 + })
  83 + console.log(that.data.list)
  84 +
  85 +
  86 +
  87 + }).catch((err) => {
  88 +
18 }) 89 })
19 }, 90 },
20 91
  92 + //进入视频页面
  93 + entervido(e){
  94 + let url=e.currentTarget.dataset.url
  95 + wx.navigateTo({
  96 + url: '/pages/homeblock/video/video?url='+url,
  97 + })
  98 + },
  99 +
  100 + //点赞和取消点赞
  101 + dianzan(e){
  102 + let that = this;
  103 + let id=e.currentTarget.dataset.id
  104 + let url = 'index/Common/good', params = {
  105 + sort:5,
  106 + id:id
  107 +
  108 + }
  109 + app.post(url, params).then((res) => {
  110 + console.log(res);
  111 + wx.showToast({
  112 + title: res,
  113 + icon:"none"
  114 + })
  115 + that.getcommentlist()
  116 +
  117 +
  118 + }).catch((err) => {
  119 +
  120 + })
  121 + },
  122 +
  123 + //评价列表
  124 + publishcomment(){
  125 + wx.navigateTo({
  126 + url: '/pages/homeblock/evalute/evalute?wineid='+this.data.id,
  127 + })
  128 + },
  129 +
  130 +
21 /** 131 /**
22 * 生命周期函数--监听页面初次渲染完成 132 * 生命周期函数--监听页面初次渲染完成
23 */ 133 */
@@ -29,7 +139,7 @@ Page({ @@ -29,7 +139,7 @@ Page({
29 * 生命周期函数--监听页面显示 139 * 生命周期函数--监听页面显示
30 */ 140 */
31 onShow: function () { 141 onShow: function () {
32 - 142 + this.getcommentlist()
33 }, 143 },
34 144
35 /** 145 /**
1 <view class="boxhead"> 1 <view class="boxhead">
2 -<view class="evalutetop">  
3 - <view class="evaluteleft">  
4 - <view class="code">7.4</view>  
5 - <view class="evalutetop">  
6 - <view class="evaluteitem">  
7 - <image src="/img/aicon_28@2x.png"></image>  
8 - </view>  
9 - <view class="evaluteitem">  
10 - <image src="/img/aicon_28@2x.png"></image>  
11 - </view>  
12 - <view class="evaluteitem">  
13 - <image src="/img/aicon_28@2x.png"></image>  
14 - </view>  
15 - <view class="evaluteitem">  
16 - <image src="/img/aicon_28@2x.png"></image>  
17 - </view>  
18 - <view class="evaluteitem">  
19 - <image src="/img/aicon_28@2x.png"></image> 2 + <view class="evalutetop">
  3 + <view class="evaluteleft">
  4 + <view class="code">{{statistics.score}}</view>
  5 + <view class="evalutetop">
  6 + <view class="evaluteitemx">
  7 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{headscore<5}}"></image>
  8 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{headscore>=55&&headscore<10}}"></image>
  9 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{headscore>=10}}"></image>
  10 + </view>
  11 + <view class="evaluteitemx">
  12 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{headscore<15}}"></image>
  13 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{headscore>=15&&headscore<20}}"></image>
  14 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{headscore>=20}}"></image>
  15 + </view>
  16 + <view class="evaluteitemx">
  17 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{headscore<25}}"></image>
  18 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{headscore>=25&&headscore<30}}"></image>
  19 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{headscore>=30}}"></image>
  20 + </view>
  21 + <view class="evaluteitemx">
  22 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{headscore<35}}"></image>
  23 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{headscore>=35&&headscore<40}}"></image>
  24 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{headscore>=40}}"></image>
  25 + </view>
  26 + <view class="evaluteitemx">
  27 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{headscore<45}}"></image>
  28 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{headscore>=45&&headscore<50}}"></image>
  29 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{headscore>=50}}"></image>
  30 + </view>
20 </view> 31 </view>
21 </view> 32 </view>
22 - </view>  
23 33
24 - <view class="evaluteright"> 34 + <view class="evaluteright">
25 <view class="star"> 35 <view class="star">
26 <view class="starleft"> 36 <view class="starleft">
27 - <view class="staritem">  
28 - <image src="/img/aicon_27@2x.png"></image>  
29 - </view>  
30 - <view class="staritem">  
31 - <image src="/img/aicon_27@2x.png"></image>  
32 - </view>  
33 - <view class="staritem">  
34 - <image src="/img/aicon_27@2x.png"></image>  
35 - </view>  
36 - <view class="staritem">  
37 - <image src="/img/aicon_27@2x.png"></image>  
38 - </view>  
39 - <view class="staritem">  
40 - <image src="/img/aicon_27@2x.png"></image>  
41 - </view> 37 + <view class="staritem">
  38 + <image src="/img/aicon_27@2x.png"></image>
  39 + </view>
  40 + <view class="staritem">
  41 + <image src="/img/aicon_27@2x.png"></image>
  42 + </view>
  43 + <view class="staritem">
  44 + <image src="/img/aicon_27@2x.png"></image>
  45 + </view>
  46 + <view class="staritem">
  47 + <image src="/img/aicon_27@2x.png"></image>
  48 + </view>
  49 + <view class="staritem">
  50 + <image src="/img/aicon_27@2x.png"></image>
  51 + </view>
42 </view> 52 </view>
43 53
44 <view class="tiao"> 54 <view class="tiao">
45 - <view class="tiaoitem"></view> 55 + <view class="tiaoitem" style="width:{{statistics.five_percent}}%"></view>
46 </view> 56 </view>
47 - <view class="pingfen">36.1%</view> 57 + <view class="pingfen">{{statistics.five_percent}}%</view>
  58 +
48 59
49 -  
50 </view> 60 </view>
51 <view class="star"> 61 <view class="star">
52 <view class="starleft"> 62 <view class="starleft">
53 - <view class="staritem">  
54 - <image src="/img/aicon_27@2x.png"></image>  
55 - </view>  
56 - <view class="staritem">  
57 - <image src="/img/aicon_27@2x.png"></image>  
58 - </view>  
59 - <view class="staritem">  
60 - <image src="/img/aicon_27@2x.png"></image>  
61 - </view>  
62 - <view class="staritem">  
63 - <image src="/img/aicon_27@2x.png"></image>  
64 - </view>  
65 - 63 + <view class="staritem">
  64 + <image src="/img/aicon_27@2x.png"></image>
  65 + </view>
  66 + <view class="staritem">
  67 + <image src="/img/aicon_27@2x.png"></image>
  68 + </view>
  69 + <view class="staritem">
  70 + <image src="/img/aicon_27@2x.png"></image>
  71 + </view>
  72 + <view class="staritem">
  73 + <image src="/img/aicon_27@2x.png"></image>
  74 + </view>
  75 +
66 </view> 76 </view>
67 77
68 <view class="tiao"> 78 <view class="tiao">
69 - <view class="tiaoitem"></view> 79 + <view class="tiaoitem" style="width:{{statistics.four_percent}}%"></view>
70 </view> 80 </view>
71 - <view class="pingfen">36.1%</view> 81 + <view class="pingfen">{{statistics.four_percent}}%</view>
  82 +
72 83
73 -  
74 </view> 84 </view>
75 <view class="star"> 85 <view class="star">
76 <view class="starleft"> 86 <view class="starleft">
77 - <view class="staritem">  
78 - <image src="/img/aicon_27@2x.png"></image>  
79 - </view>  
80 - <view class="staritem">  
81 - <image src="/img/aicon_27@2x.png"></image>  
82 - </view>  
83 - <view class="staritem">  
84 - <image src="/img/aicon_27@2x.png"></image>  
85 - </view>  
86 - 87 + <view class="staritem">
  88 + <image src="/img/aicon_27@2x.png"></image>
  89 + </view>
  90 + <view class="staritem">
  91 + <image src="/img/aicon_27@2x.png"></image>
  92 + </view>
  93 + <view class="staritem">
  94 + <image src="/img/aicon_27@2x.png"></image>
  95 + </view>
  96 +
87 </view> 97 </view>
88 98
89 <view class="tiao"> 99 <view class="tiao">
90 - <view class="tiaoitem"></view> 100 + <view class="tiaoitem" style="width:{{statistics.three_percent}}%"></view>
91 </view> 101 </view>
92 - <view class="pingfen">36.1%</view> 102 + <view class="pingfen">{{statistics.three_percent}}%</view>
  103 +
93 104
94 -  
95 </view> 105 </view>
96 <view class="star"> 106 <view class="star">
97 <view class="starleft"> 107 <view class="starleft">
98 - <view class="staritem">  
99 - <image src="/img/aicon_27@2x.png"></image>  
100 - </view>  
101 - <view class="staritem">  
102 - <image src="/img/aicon_27@2x.png"></image>  
103 - </view>  
104 - 108 + <view class="staritem">
  109 + <image src="/img/aicon_27@2x.png"></image>
  110 + </view>
  111 + <view class="staritem">
  112 + <image src="/img/aicon_27@2x.png"></image>
  113 + </view>
  114 +
105 </view> 115 </view>
106 116
107 <view class="tiao"> 117 <view class="tiao">
108 - <view class="tiaoitem"></view> 118 + <view class="tiaoitem" style="width:{{statistics.two_percent}}%"></view>
109 </view> 119 </view>
110 - <view class="pingfen">36.1%</view> 120 + <view class="pingfen">{{statistics.two_percent}}%</view>
  121 +
111 122
112 -  
113 </view> 123 </view>
114 <view class="star"> 124 <view class="star">
115 <view class="starleft"> 125 <view class="starleft">
116 - <view class="staritem">  
117 - <image src="/img/aicon_27@2x.png"></image>  
118 - </view>  
119 - 126 + <view class="staritem">
  127 + <image src="/img/aicon_27@2x.png"></image>
  128 + </view>
  129 +
120 </view> 130 </view>
121 131
122 <view class="tiao"> 132 <view class="tiao">
123 - <view class="tiaoitem"></view> 133 + <view class="tiaoitem" style="width:{{statistics.one_percent}}%"></view>
124 </view> 134 </view>
125 - <view class="pingfen">36.1%</view> 135 + <view class="pingfen">{{statistics.one_percent}}%</view>
  136 +
126 137
127 -  
128 </view> 138 </view>
  139 + </view>
129 </view> 140 </view>
130 -</view>  
131 141
132 -<view class="hotticket">热门标签</view> 142 + <view class="hotticket">热门标签</view>
133 143
134 -<view class="botlabet">  
135 - <view class="labelitem">  
136 - <text>婚宴</text>  
137 - <text class="labelitemright">63</text>  
138 - </view>  
139 - <view class="labelitem">  
140 - <text>喜庆</text>  
141 - <text class="labelitemright">63</text> 144 + <view class="botlabet">
  145 + <view class="labelitem" wx:for="{{hot_tag}}" wx:key=''>
  146 + <text>{{item.name}}</text>
  147 + <text class="labelitemright">{{item.comment_count}}</text>
142 </view> 148 </view>
143 - <view class="labelitem">  
144 - <text>好喝</text>  
145 - <text class="labelitemright">63</text>  
146 - </view>  
147 - <view class="labelitem">  
148 - <text>实惠</text>  
149 - <text class="labelitemright">63</text>  
150 - </view>  
151 -</view> 149 +
  150 + </view>
152 151
153 </view> 152 </view>
154 153
155 <view class="boxmiddle"> 154 <view class="boxmiddle">
156 - <view class="boxmiddleitem"> 155 + <view class="boxmiddleitem" wx:for="{{list}}" wx:key=''>
157 <view class="evaluteitemleft"> 156 <view class="evaluteitemleft">
158 - <image src="{{url}}/aicon_45@2x.png"></image> 157 + <image src="{{item.avatar}}"></image>
159 </view> 158 </view>
160 159
161 <view class="evaluteitemright"> 160 <view class="evaluteitemright">
162 - <view class="evalname">小叶子</view> 161 + <view class="evalname">{{item.user_nickname}}</view>
163 <view class="evalstarword"> 162 <view class="evalstarword">
164 - <view class="evalstar">  
165 - <view class="evalstaritem">  
166 - <image src="/img/aicon_28@2x.png"></image>  
167 - </view>  
168 - <view class="evalstaritem">  
169 - <image src="/img/aicon_28@2x.png"></image>  
170 - </view>  
171 - <view class="evalstaritem">  
172 - <image src="/img/aicon_28@2x.png"></image>  
173 - </view>  
174 - <view class="evalstaritem">  
175 - <image src="/img/aicon_28@2x.png"></image>  
176 - </view>  
177 - <view class="evalstaritem">  
178 - <image src="/img/aicon_28@2x.png"></image>  
179 - </view>  
180 - <view class="evalstaritem">  
181 - <image src="/img/aicon_28@2x.png"></image>  
182 - </view> 163 + <view class="evalstar">
  164 + <view class="evalstaritem">
  165 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{item.score<5}}"></image>
  166 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{item.score>=55&&item.score<10}}"></image>
  167 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{item.score>=10}}"></image>
  168 + </view>
  169 + <view class="evalstaritem">
  170 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{item.score<15}}"></image>
  171 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{item.score>=15&&item.score<20}}"></image>
  172 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{item.score>=20}}"></image>
  173 + </view>
  174 + <view class="evalstaritem">
  175 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{item.score<25}}"></image>
  176 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{item.score>=25&&item.score<30}}"></image>
  177 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{item.score>=30}}"></image>
  178 + </view>
  179 + <view class="evalstaritem">
  180 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{item.score<35}}"></image>
  181 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{item.score>=35&&item.score<40}}"></image>
  182 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{item.score>=40}}"></image>
  183 + </view>
  184 + <view class="evalstaritem">
  185 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{item.score<45}}"></image>
  186 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{item.score>=45&&item.score<50}}"></image>
  187 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{item.score>=50}}"></image>
183 </view> 188 </view>
184 189
185 - <view class="evardate">2019年11月5日</view> 190 + </view>
  191 +
  192 + <view class="evardate">{{item.create_time}}</view>
186 </view> 193 </view>
187 194
188 - <view class="evaltext">弟弟结婚买了8箱</view>  
189 - <view class="zan">  
190 - <view class="zanimg">  
191 - <image src="/img/aicon_46x.png"></image> 195 + <view class="evaltext">{{item.content}}</view>
  196 + <view class="medioblock">
  197 + <block wx:if="{{item.files.length!=0}}">
  198 + <view class="evalimgitem" wx:for='{{item.files}}' wx:key="">
  199 + <image src="{{item}}"></image>
192 </view> 200 </view>
193 201
194 - <view class="zannum">6.2k</view>  
195 - </view>  
196 -  
197 - </view>  
198 - </view>  
199 202
200 - <view class="boxmiddleitem">  
201 - <view class="evaluteitemleft">  
202 - <image src="{{url}}/aicon_45@2x.png"></image>  
203 - </view> 203 + </block>
204 204
205 - <view class="evaluteitemright">  
206 - <view class="evalname">小叶子</view>  
207 - <view class="evalstarword">  
208 - <view class="evalstar">  
209 - <view class="evalstaritem">  
210 - <image src="/img/aicon_28@2x.png"></image>  
211 - </view>  
212 - <view class="evalstaritem">  
213 - <image src="/img/aicon_28@2x.png"></image>  
214 - </view>  
215 - <view class="evalstaritem">  
216 - <image src="/img/aicon_28@2x.png"></image>  
217 - </view>  
218 - <view class="evalstaritem">  
219 - <image src="/img/aicon_28@2x.png"></image>  
220 - </view>  
221 - <view class="evalstaritem">  
222 - <image src="/img/aicon_28@2x.png"></image>  
223 - </view>  
224 - <view class="evalstaritem">  
225 - <image src="/img/aicon_28@2x.png"></image>  
226 - </view>  
227 - </view> 205 + <view class="evalimgitem videoimg" wx:if="{{item.video!=''}}" data-url="{{item.video}}" bindtap="entervido">
  206 + <image src="{{item.video_image}}"></image>
228 207
229 - <view class="evardate">2019年11月5日</view> 208 + <view class="videoanniu">
  209 + <image src="{{url}}/aicon_70x.png"></image>
  210 + </view>
  211 + </view>
230 </view> 212 </view>
231 213
232 - <view class="evaltext">弟弟结婚买了8箱</view>  
233 214
234 - <view class="evalimg">  
235 - <view class="evalimgitem">  
236 - <image src="{{url}}/aicon_49@2x.png"></image>  
237 - </view>  
238 - <view class="evalimgitem">  
239 - <image src="{{url}}/aicon_49@2x.png"></image>  
240 - </view>  
241 - <view class="evalimgitem">  
242 - <image src="{{url}}/aicon_49@2x.png"></image>  
243 - </view>  
244 - <view class="evalimgitem">  
245 - <image src="{{url}}/aicon_49@2x.png"></image> 215 +
  216 +
  217 + <view class="zan">
  218 + <view class="zanimg" bindtap="dianzan" data-id="{{item.id}}">
  219 + <image src="/img/aicon_46x.png" wx:if="{{item.is_good==1}}"></image>
  220 + <image src="/img/aicon_47x.png" wx:if="{{item.is_good==0}}"></image>
246 </view> 221 </view>
  222 +
  223 + <view class="zannum">{{item.good_count}}</view>
247 </view> 224 </view>
248 - </view>  
249 - </view>  
250 -</view>  
251 225
252 -<view class="write">  
253 - <view class="writeimg">  
254 - <image src="{{url}}/aicon_48x.png"></image>  
255 </view> 226 </view>
  227 + </view>
256 </view> 228 </view>
257 229
258 -  
259 - 230 +<view class="write" bindtap="publishcomment">
  231 + <view class="writeimg">
  232 + <image src="{{url}}/aicon_48x.png"></image>
  233 + </view>
  234 +</view>
@@ -11,12 +11,16 @@ page { @@ -11,12 +11,16 @@ page {
11 box-sizing: border-box; 11 box-sizing: border-box;
12 } 12 }
13 13
14 -.evaluteitem { 14 +.evaluteitemx {
15 width: 26rpx; 15 width: 26rpx;
16 height: 24rpx; 16 height: 24rpx;
17 font-size: 0; 17 font-size: 0;
18 margin-left: 9rpx; 18 margin-left: 9rpx;
19 } 19 }
  20 +.evaluteitemx image{
  21 + width:100%!important;
  22 + height:100%!important;
  23 +}
20 24
21 image { 25 image {
22 width: 100%; 26 width: 100%;
@@ -73,7 +77,7 @@ image { @@ -73,7 +77,7 @@ image {
73 } 77 }
74 78
75 .tiaoitem { 79 .tiaoitem {
76 - width: 59%; 80 + /* width: 59%; */
77 height: 6rpx; 81 height: 6rpx;
78 border-radius: 2rpx; 82 border-radius: 2rpx;
79 background: #ffba25; 83 background: #ffba25;
@@ -106,6 +110,7 @@ image { @@ -106,6 +110,7 @@ image {
106 .boxmiddle { 110 .boxmiddle {
107 padding: 0 30rpx; 111 padding: 0 30rpx;
108 box-sizing: border-box; 112 box-sizing: border-box;
  113 + padding-bottom: 100rpx;
109 } 114 }
110 115
111 .evaluteitem { 116 .evaluteitem {
@@ -119,6 +124,9 @@ image { @@ -119,6 +124,9 @@ image {
119 background: rgba(205, 205, 205, 1); 124 background: rgba(205, 205, 205, 1);
120 border-radius: 50%; 125 border-radius: 50%;
121 } 126 }
  127 +.evaluteitemleft image{
  128 + border-radius:50%;
  129 +}
122 130
123 .evalname { 131 .evalname {
124 color: #666; 132 color: #666;
@@ -176,9 +184,13 @@ image { @@ -176,9 +184,13 @@ image {
176 height: 190rpx; 184 height: 190rpx;
177 border-radius: 5rpx; 185 border-radius: 5rpx;
178 font-size: 0; 186 font-size: 0;
179 - margin-left:10rpx; 187 + margin-right:10rpx;
180 margin-top:30rpx; 188 margin-top:30rpx;
181 } 189 }
  190 +.evalimgitem video{
  191 + width: 190rpx!important;
  192 + height: 190rpx !important;
  193 +}
182 194
183 .evalimg{ 195 .evalimg{
184 display:flex; 196 display:flex;
@@ -188,7 +200,8 @@ image { @@ -188,7 +200,8 @@ image {
188 .zan{ 200 .zan{
189 display:flex; 201 display:flex;
190 align-items:center; 202 align-items:center;
191 - justify-content: flex-end 203 + justify-content: flex-end;
  204 + margin-top:30rpx;
192 } 205 }
193 206
194 .zanimg{ 207 .zanimg{
@@ -207,10 +220,33 @@ image { @@ -207,10 +220,33 @@ image {
207 font-size: 0 220 font-size: 0
208 } 221 }
209 .write{ 222 .write{
  223 + width:750rpx;
210 background: #fff; 224 background: #fff;
211 height:126rpx; 225 height:126rpx;
212 display: flex; 226 display: flex;
213 justify-content: flex-end; 227 justify-content: flex-end;
214 padding:17rpx 30rpx 0; 228 padding:17rpx 30rpx 0;
215 - box-sizing: border-box 229 + box-sizing: border-box;
  230 + position: fixed;
  231 + bottom:0;
  232 +}
  233 +.medioblock{
  234 + display:flex;
  235 + flex-wrap: wrap;
  236 +}
  237 +.videoimg{
  238 + position: relative
  239 +}
  240 +.videoanniu{
  241 + width:90rpx;
  242 + height:90rpx;
  243 + font-size: 0;
  244 + position: absolute;
  245 + left:50%;
  246 + top:50%;
  247 + transform: translate(-50%,-50%)
  248 +}
  249 +.videoanniu image{
  250 + width:100%;
  251 + height:100%;
216 } 252 }
1 // pages/homeblock/guanimg/guanimg.js 1 // pages/homeblock/guanimg/guanimg.js
2 -const app=getApp() 2 +const app = getApp()
3 Page({ 3 Page({
4 4
5 /** 5 /**
6 * 页面的初始数据 6 * 页面的初始数据
7 */ 7 */
8 data: { 8 data: {
9 - url:'' 9 + url: '',
  10 + id: "",
  11 + picture:[],
  12 + banner:[]
10 }, 13 },
11 14
12 /** 15 /**
13 * 生命周期函数--监听页面加载 16 * 生命周期函数--监听页面加载
14 */ 17 */
15 - onLoad: function (options) { 18 + onLoad: function(options) {
16 this.setData({ 19 this.setData({
17 - url: app.globalData.url 20 + url: app.globalData.url,
  21 + id: options.wineid
18 }) 22 })
  23 +
  24 + this.getguantu()
19 }, 25 },
  26 + //获取官图
  27 + getguantu() {
  28 + let that = this;
  29 + let url = 'index/Wine/wine_images',
  30 + params = {
  31 + wine_id:that.data.id,
  32 +
  33 + }
  34 + app.post(url, params).then((res) => {
  35 + console.log(res);
  36 + that.setData({
  37 + banner:res.banner,
  38 + picture: res.picture
  39 + })
  40 +
  41 +
20 42
  43 + }).catch((err) => {
  44 +
  45 + })
  46 + },
21 /** 47 /**
22 * 生命周期函数--监听页面初次渲染完成 48 * 生命周期函数--监听页面初次渲染完成
23 */ 49 */
24 - onReady: function () { 50 + onReady: function() {
25 51
26 }, 52 },
27 53
28 /** 54 /**
29 * 生命周期函数--监听页面显示 55 * 生命周期函数--监听页面显示
30 */ 56 */
31 - onShow: function () { 57 + onShow: function() {
32 58
33 }, 59 },
34 60
35 /** 61 /**
36 * 生命周期函数--监听页面隐藏 62 * 生命周期函数--监听页面隐藏
37 */ 63 */
38 - onHide: function () { 64 + onHide: function() {
39 65
40 }, 66 },
41 67
42 /** 68 /**
43 * 生命周期函数--监听页面卸载 69 * 生命周期函数--监听页面卸载
44 */ 70 */
45 - onUnload: function () { 71 + onUnload: function() {
46 72
47 }, 73 },
48 74
49 /** 75 /**
50 * 页面相关事件处理函数--监听用户下拉动作 76 * 页面相关事件处理函数--监听用户下拉动作
51 */ 77 */
52 - onPullDownRefresh: function () { 78 + onPullDownRefresh: function() {
53 79
54 }, 80 },
55 81
56 /** 82 /**
57 * 页面上拉触底事件的处理函数 83 * 页面上拉触底事件的处理函数
58 */ 84 */
59 - onReachBottom: function () { 85 + onReachBottom: function() {
60 86
61 }, 87 },
62 88
63 /** 89 /**
64 * 用户点击右上角分享 90 * 用户点击右上角分享
65 */ 91 */
66 - onShareAppMessage: function () { 92 + onShareAppMessage: function() {
67 93
68 } 94 }
69 }) 95 })
@@ -3,18 +3,10 @@ @@ -3,18 +3,10 @@
3 3
4 </view> 4 </view>
5 <view class="biaozhaunbox"> 5 <view class="biaozhaunbox">
6 - <view class="biaozhuanitem">  
7 - <image src="{{url}}aicon_89@2x.png"></image>  
8 - </view>  
9 - <view class="biaozhuanitem">  
10 - <image src="{{url}}aicon_89@2x.png"></image>  
11 - </view>  
12 - <view class="biaozhuanitem">  
13 - <image src="{{url}}aicon_89@2x.png"></image>  
14 - </view>  
15 - <view class="biaozhuanitem">  
16 - <image src="{{url}}aicon_89@2x.png"></image> 6 + <view class="biaozhuanitem" wx:for="{{banner}}" wx:key="">
  7 + <image src="{{item.url}}"></image>
17 </view> 8 </view>
  9 +
18 </view> 10 </view>
19 11
20 12
@@ -24,16 +16,8 @@ @@ -24,16 +16,8 @@
24 16
25 </view> 17 </view>
26 <view class="biaozhaunbox"> 18 <view class="biaozhaunbox">
27 - <view class="biaozhuanitem">  
28 - <image src="{{url}}aicon_89@2x.png"></image>  
29 - </view>  
30 - <view class="biaozhuanitem">  
31 - <image src="{{url}}aicon_89@2x.png"></image>  
32 - </view>  
33 - <view class="biaozhuanitem">  
34 - <image src="{{url}}aicon_89@2x.png"></image>  
35 - </view>  
36 - <view class="biaozhuanitem">  
37 - <image src="{{url}}aicon_89@2x.png"></image> 19 + <view class="biaozhuanitem" wx:for="{{picture}}" wx:key=''>
  20 + <image src="{{item.url}}"></image>
38 </view> 21 </view>
  22 +
39 </view> 23 </view>
1 // pages/homeblock/jiuzidian/jiuzidian.js 1 // pages/homeblock/jiuzidian/jiuzidian.js
  2 +var WxParse = require('../../../wxParse/wxParse.js');
2 const app=getApp() 3 const app=getApp()
3 Page({ 4 Page({
4 5
@@ -6,24 +7,26 @@ Page({ @@ -6,24 +7,26 @@ Page({
6 * 页面的初始数据 7 * 页面的初始数据
7 */ 8 */
8 data: { 9 data: {
9 - navarr: [  
10 - {  
11 - name: '基本参数'  
12 - },  
13 - {  
14 - name: '生产企业'  
15 - },  
16 - {  
17 - name: '酿酒师'  
18 - },  
19 - {  
20 - name: '关键词'  
21 - }, ], 10 + navarr: [],
22 11
23 current: 0, 12 current: 0,
24 url:'', 13 url:'',
25 kind:0, 14 kind:0,
26 - picindex:0 15 + picindex:0,
  16 + id:'',
  17 + wineinfo:'',
  18 + selectid:-1,
  19 + canshu:[],
  20 + qiye:[],
  21 + jiushi:[],
  22 + jiushiarr: [],
  23 + zhuanye:[],
  24 + jiben:[],
  25 + jiushishow:true,
  26 + othercontent:[],
  27 + qiyearr:[],
  28 + score:''
  29 +
27 }, 30 },
28 31
29 /** 32 /**
@@ -31,7 +34,189 @@ Page({ @@ -31,7 +34,189 @@ Page({
31 */ 34 */
32 onLoad: function (options) { 35 onLoad: function (options) {
33 this.setData({ 36 this.setData({
34 - url: app.globalData.url 37 + url: app.globalData.url,
  38 + id:options.id,
  39 + wineinfo:''
  40 + })
  41 +
  42 +
  43 + this.getwinedetail()
  44 + },
  45 + //获取酒品详情
  46 + getwinedetail(){
  47 + let that = this;
  48 + let url = 'index/Wine/detail', params = {
  49 + wine_id: that.data.id,
  50 +
  51 + }
  52 + app.post(url, params).then((res) => {
  53 + console.log(res);
  54 + that.setData({
  55 + wineinfo:res,
  56 + navarr: res.wine_attr,
  57 + score: res.score*10
  58 + })
  59 +
  60 + console.log(that.data.score)
  61 +
  62 + let newnavarr = that.data.navarr;
  63 + for (var obj of newnavarr){
  64 + if(obj.id==-1){
  65 + that.setData({
  66 + canshu:obj.value
  67 + })
  68 + }else if(obj.id==-2){
  69 +
  70 + that.setData({
  71 + qiye:obj.value[0].attr,
  72 + qiyearr:obj.value[0]
  73 + })
  74 +
  75 + let newqiye = obj.value[0].attr;
  76 +
  77 + for (let i = 0; i < newqiye.length; i++) {
  78 + newqiye[i].show = true
  79 +
  80 + WxParse.wxParse('content' + i, 'html', newqiye[i]['content'], that, 5);
  81 +
  82 + if (i === newqiye.length - 1) {
  83 +
  84 + WxParse.wxParseTemArray("artileList", 'content', newqiye.length, that)
  85 + }
  86 + }
  87 +
  88 + that.setData({
  89 + qiye: newqiye
  90 + })
  91 +
  92 +
  93 +
  94 + } else if (obj.id == -3) {
  95 + that.setData({
  96 + jiushi: obj.value[0],
  97 + jiushiarr:obj.value[0].attr
  98 + })
  99 +
  100 + let newjiushiarr = obj.value[0].attr
  101 +
  102 +
  103 + for (let i = 0; i < newjiushiarr.length; i++) {
  104 + newjiushiarr[i].show = true
  105 +
  106 + WxParse.wxParse('content' + i, 'html', newjiushiarr[i]['content'], that, 5);
  107 +
  108 + if (i === newjiushiarr.length - 1) {
  109 +
  110 + WxParse.wxParseTemArray("artileList1", 'content', newjiushiarr.length, that)
  111 + }
  112 + }
  113 +
  114 + that.setData({
  115 + jiushiarr:newjiushiarr
  116 + })
  117 +
  118 + } else if (obj.id == -4) {
  119 + that.setData({
  120 + zhuanye: obj.value
  121 + })
  122 +
  123 + let newzhuanye = obj.value
  124 + for (let i = 0; i < newzhuanye.length; i++) {
  125 + newzhuanye[i].show = true
  126 +
  127 + WxParse.wxParse('content' + i, 'html', newzhuanye[i]['content'], that, 5);
  128 +
  129 + if (i === newzhuanye.length - 1) {
  130 +
  131 + WxParse.wxParseTemArray("artileList2", 'content', newzhuanye.length, that)
  132 + }
  133 + }
  134 +
  135 + that.setData({
  136 + zhuanye: newzhuanye
  137 + })
  138 +
  139 + } else if (obj.id == -5) {
  140 + that.setData({
  141 + jiben: obj.value
  142 + })
  143 + }else{
  144 + that.setData({
  145 + othercontent: obj.value
  146 + })
  147 +
  148 + let newothercontent = obj.value
  149 + for (let i = 0; i < newothercontent.length; i++) {
  150 + newothercontent[i].show = true
  151 +
  152 + WxParse.wxParse('content' + i, 'html', newothercontent[i]['content'], that, 5);
  153 +
  154 + if (i === newothercontent.length - 1) {
  155 +
  156 + WxParse.wxParseTemArray("artileList4", 'content', newothercontent.length, that)
  157 + }
  158 + }
  159 +
  160 + that.setData({
  161 + othercontent: newothercontent
  162 + })
  163 +
  164 + }
  165 + }
  166 +
  167 +
  168 +
  169 + }).catch((err) => {
  170 +
  171 + })
  172 + },
  173 + jiushinfoshow(){
  174 + this.setData({
  175 + jiushishow: !this.data.jiushishow
  176 + })
  177 + },
  178 + //关注酒师
  179 + attenjiushi(e){
  180 + let that = this;
  181 + let id=e.currentTarget.dataset.id
  182 + let url = 'index/Common/concern', params = {
  183 + sort: 2,
  184 + id:id
  185 +
  186 + }
  187 + app.post(url, params).then((res) => {
  188 + console.log(res);
  189 + wx.showToast({
  190 + title: res,
  191 + icon:'none'
  192 + })
  193 +
  194 + that.getwinedetail()
  195 +
  196 + }).catch((err) => {
  197 +
  198 + })
  199 + },
  200 + //关注企业
  201 + attenqiye(e){
  202 + let that = this;
  203 + let id = e.currentTarget.dataset.id
  204 + let url = 'index/Common/concern', params = {
  205 + sort: 1,
  206 + id: id
  207 +
  208 + }
  209 + app.post(url, params).then((res) => {
  210 + console.log(res);
  211 + wx.showToast({
  212 + title: res,
  213 + icon: 'none'
  214 + })
  215 +
  216 + that.getwinedetail()
  217 +
  218 + }).catch((err) => {
  219 +
35 }) 220 })
36 }, 221 },
37 selectkind(e){ 222 selectkind(e){
@@ -40,17 +225,84 @@ Page({ @@ -40,17 +225,84 @@ Page({
40 }) 225 })
41 }, 226 },
42 select(e) { 227 select(e) {
  228 + console.log(e)
43 this.setData({ 229 this.setData({
44 - current: e.currentTarget.dataset.idx 230 + current: e.currentTarget.dataset.idx,
  231 + selectid:e.currentTarget.dataset.id
45 }) 232 })
46 - console.log(this.data.current) 233 + console.log(this.data.selectid)
47 }, 234 },
48 selectpic(e){ 235 selectpic(e){
  236 + let pic = e.currentTarget.dataset.pic
49 this.setData({ 237 this.setData({
50 picindex:e.currentTarget.dataset.pic 238 picindex:e.currentTarget.dataset.pic
51 }) 239 })
52 240
53 - console.log(this.data.picindex) 241 + if (pic==1){
  242 + wx.navigateTo({
  243 + url: '/pages/homeblock/guanimg/guanimg?wineid='+this.data.id,
  244 + })
  245 + }else if(pic==2){
  246 + wx.navigateTo({
  247 + url: '/pages/homeblock/shipaiimg/shipaiimg?wineid='+this.data.id,
  248 + })
  249 + }else if(pic==3){
  250 + wx.navigateTo({
  251 + url: '/pages/homeblock/shortvideo/shortvideo?wineid='+this.data.id,
  252 + })
  253 + }
  254 +
  255 +
  256 + },
  257 +
  258 + showinfo(e) {
  259 + let idx = e.currentTarget.dataset.idx;
  260 + console.log(idx)
  261 + let newqiye = this.data.qiye;
  262 + for (var i = 0; i < newqiye.length; i++) {
  263 + if (i == idx) {
  264 + newqiye[i].show = !newqiye[i].show
  265 + }
  266 + }
  267 + this.setData({
  268 + qiye: newqiye
  269 + })
  270 + },
  271 +
  272 + showjiushi(e){
  273 + let idx = e.currentTarget.dataset.idx;
  274 + console.log(idx)
  275 + let newjiushiarr = this.data.jiushiarr;
  276 + for (var i = 0; i < newjiushiarr.length; i++) {
  277 + if (i == idx) {
  278 + newjiushiarr[i].show = !newjiushiarr[i].show
  279 + }
  280 + }
  281 + this.setData({
  282 + jiushiarr: newjiushiarr
  283 + })
  284 + },
  285 +
  286 + showzhuanye(e){
  287 + let idx = e.currentTarget.dataset.idx;
  288 + console.log(idx)
  289 + let newzhuanye = this.data.zhuanye;
  290 + for (var i = 0; i < newzhuanye.length; i++) {
  291 + if (i == idx) {
  292 + newzhuanye[i].show = !newzhuanye[i].show
  293 + }
  294 + }
  295 + this.setData({
  296 + zhuanye: newzhuanye
  297 + })
  298 + },
  299 +
  300 + //评价页面
  301 + evalute(){
  302 +
  303 + wx.navigateTo({
  304 + url: '/pages/homeblock/evalutecontent/evalutecontent?wineid='+this.data.id,
  305 + })
54 }, 306 },
55 307
56 /** 308 /**
  1 +<import src="../../../wxParse/wxParse.wxml" />
1 <!-- 展示图 --> 2 <!-- 展示图 -->
2 <view class="showpic"> 3 <view class="showpic">
3 - <image src="{{url}}/aicon_89@2x.png"></image> 4 + <image src="{{wineinfo.logo}}"></image>
4 5
5 <view class="kindlist"> 6 <view class="kindlist">
6 - <view class="kinditem {{kind==0?'kindactive':''}}" data-kind='0' bindtap="selectkind">瓶</view>  
7 - <view class="kinditem {{kind==1?'kindactive':''}}" data-kind='1' bindtap="selectkind">箱</view>  
8 - <view class="kinditem {{kind==2?'kindactive':''}}" data-kind='2' bindtap="selectkind">盒</view> 7 + <view class="kinditem {{kind==0?'kindactive':''}}" data-kind='0' bindtap="selectkind">瓶</view>
  8 + <view class="kinditem {{kind==1?'kindactive':''}}" data-kind='1' bindtap="selectkind">盒</view>
  9 + <view class="kinditem {{kind==2?'kindactive':''}}" data-kind='2' bindtap="selectkind">箱</view>
9 </view> 10 </view>
10 11
11 <view class="pickind"> 12 <view class="pickind">
12 - <view class="picitem {{picindex==0?'slectpic':''}}" data-pic="0" bindtap="selectpic">全景</view>  
13 - <view class="picitem {{picindex==1?'slectpic':''}}" data-pic="1" bindtap="selectpic">官图</view>  
14 - <view class="picitem {{picindex==2?'slectpic':''}}" data-pic="2" bindtap="selectpic">实拍</view>  
15 - <view class="picitem {{picindex==3?'slectpic':''}}" data-pic="3" bindtap="selectpic">短视频</view> 13 + <view class="picitem {{picindex==0?'slectpic':''}}" data-pic="0" bindtap="selectpic">全景</view>
  14 + <view class="picitem {{picindex==1?'slectpic':''}}" data-pic="1" bindtap="selectpic">官图</view>
  15 + <view class="picitem {{picindex==2?'slectpic':''}}" data-pic="2" bindtap="selectpic">实拍</view>
  16 + <view class="picitem {{picindex==3?'slectpic':''}}" data-pic="3" bindtap="selectpic">短视频</view>
16 </view> 17 </view>
17 </view> 18 </view>
18 -<view class="shaisel">  
19 19
20 - <view class="kind">  
21 - <view class="shaikind" wx:for="{{navarr}}" wx:key='' bindtap="select" data-idx="{{index}}">  
22 - <view class="shaikindname {{current==index?'selactive':''}}">{{item.name}}</view>  
23 - <view class="shaikindimg">  
24 - <image src="{{current==index?'http://winesbook.cn/static/images_mini/aicon_16@2x.png':'http://winesbook.cn/static/images_mini/aicon_14x.png'}}"></image>  
25 - </view> 20 +<view class="gaunfang">
  21 + <view class="guanfangtitle">{{wineinfo.name}}</view>
  22 + <view class="duigou" style="margin-left:20rpx;">
  23 + <image src="{{url}}aicon_20x.png"></image>
  24 + </view>
  25 + <view class="guanfang">官方认证</view>
  26 + <view class="wujiao">
  27 + <view class="wujiaoimg 1">
  28 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{score<5}}"></image>
  29 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{score>=55&&score<10}}"></image>
  30 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{score>=10}}"></image>
  31 +
26 </view> 32 </view>
27 - <!-- <view class="shaikind">  
28 - <view class="shaikindname">价格</view>  
29 - <view class="shaikindimg">  
30 - <image src="{{url}}aicon_14x.png"></image>  
31 - </view> 33 + <view class="wujiaoimg 2">
  34 +
  35 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{score<15}}"></image>
  36 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{score>=15&&score<20}}"></image>
  37 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{score>=20}}"></image>
32 </view> 38 </view>
33 - <view class="shaikind">  
34 - <view class="shaikindname">包装</view>  
35 - <view class="shaikindimg">  
36 - <image src="{{url}}aicon_14x.png"></image>  
37 - </view> 39 + <view class="wujiaoimg 3">
  40 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{score<25}}"></image>
  41 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{score>=25&&score<30}}"></image>
  42 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{score>=30}}"></image>
38 </view> 43 </view>
39 - <view class="shaikind">  
40 - <view class="shaikindname">产区</view>  
41 - <view class="shaikindimg">  
42 - <image src="{{url}}aicon_14x.png"></image>  
43 - </view> 44 + <view class="wujiaoimg 4">
  45 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{score<35}}"></image>
  46 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{score>=35&&score<40}}"></image>
  47 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{score>=40}}"></image>
44 </view> 48 </view>
45 - <view class="shaikind">  
46 - <view class="shaikindname">香型</view>  
47 - <view class="shaikindimg">  
48 - <image src="{{url}}aicon_14x.png"></image>  
49 - </view> 49 + <view class="wujiaoimg 5">
  50 + <image src="{{url}}/aicon_37@2x.png" wx:if="{{score<45}}"></image>
  51 + <image src="{{url}}/aicon_38@2x.png" wx:if="{{score>=45&&score<50}}"></image>
  52 + <image src="{{url}}/aicon_39@2x.png" wx:if="{{score>=50}}"></image>
50 </view> 53 </view>
51 - <view class="shaikind">  
52 - <view class="shaikindname">产区</view> 54 + </view>
  55 +
  56 + <view class="fen">{{wineinfo.score}}分</view>
  57 +
  58 +</view>
  59 +<view class="shaisel">
  60 +
  61 + <view class="kind">
  62 + <view class="shaikind" wx:for="{{navarr}}" wx:key='' bindtap="select" data-idx="{{index}}" data-id="{{item.id}}">
  63 + <view class="shaikindname {{current==index?'selactive':''}}">{{item.name}}</view>
53 <view class="shaikindimg"> 64 <view class="shaikindimg">
54 - <image src="{{url}}aicon_14x.png"></image> 65 + <!-- <image src="{{current==index?'http://winesbook.cn/static/images_mini/aicon_16@2x.png':'http://winesbook.cn/static/images_mini/aicon_14x.png'}}"></image> -->
55 </view> 66 </view>
56 </view> 67 </view>
57 - <view class="shaikind">  
58 - <view class="shaikindname">评分</view>  
59 - <view class="shaikindimg">  
60 - <image src="{{url}}aicon_14x.png"></image>  
61 - </view>  
62 - </view> --> 68 +
63 69
64 </view> 70 </view>
65 71
@@ -72,86 +78,55 @@ @@ -72,86 +78,55 @@
72 </view> 78 </view>
73 79
74 <!-- 基本参数 --> 80 <!-- 基本参数 -->
75 -<view class="jibencanshu" wx:if="{{current==0}}">  
76 - <view class="canshuitem">  
77 - <view class="canleft">酒精度</view>  
78 - <view class='cantext'>52%Vol.</view>  
79 - </view>  
80 - <view class="canshuitem">  
81 - <view class="canleft">净含量</view>  
82 - <view class='cantext'>52%500ml</view>  
83 - </view>  
84 - <view class="canshuitem">  
85 - <view class="canleft">原料</view>  
86 - <view class='cantext'>糯、稻、玉米、小麦、高粱</view>  
87 - </view>  
88 - <view class="canshuitem">  
89 - <view class="canleft">储存条件</view>  
90 - <view class='cantext'>52%请置放于干燥、阴凉、通风处</view>  
91 - </view>  
92 - <view class="canshuitem">  
93 - <view class="canleft">生产标准号</view>  
94 - <view class='cantext'>87865788</view>  
95 - </view>  
96 - <view class="canshuitem">  
97 - <view class="canleft">生产许可证号</view>  
98 - <view class='cantext'>87865788</view> 81 +<view class="jibencanshu" wx:if="{{selectid==-1}}">
  82 + <view class="canshuitem" wx:for='{{canshu}}' wx:key="">
  83 + <view class="canleft">{{item.name}}</view>
  84 + <view class='cantext'>{{item.content}}</view>
99 </view> 85 </view>
100 86
101 </view> 87 </view>
102 88
103 <!-- 生产企业 --> 89 <!-- 生产企业 -->
104 90
105 -<view class="jiuqiye" wx:if="{{current==1}}"> 91 +<view class="jiuqiye" wx:elif="{{selectid==-2}}">
106 <view class="brandbottom"> 92 <view class="brandbottom">
107 <view class="brandboleft"> 93 <view class="brandboleft">
108 - <text class="brandtitle">湖北白云边股份股份有限公司</text> 94 + <text class="brandtitle">{{qiyearr.name}}</text>
109 <view class="duigou"> 95 <view class="duigou">
110 <image src="{{url}}aicon_20x.png"></image> 96 <image src="{{url}}aicon_20x.png"></image>
111 </view> 97 </view>
112 </view> 98 </view>
113 99
114 - <view class="atten">关注</view> 100 + <view class="atten" wx:if="{{qiyearr.is_concern==0}}" bindtap="attenqiye" data-id="{{qiyearr.id}}">关注</view>
  101 + <view class="atten" wx:if="{{qiyearr.is_concern==1}}" bindtap="attenqiye" data-id="{{qiyearr.id}}">取消关注</view>
115 102
116 </view> 103 </view>
117 104
118 <view class="brandbox"> 105 <view class="brandbox">
119 - <view class="brandboxitem"> 106 + <view class="brandboxitem" wx:for="{{qiye}}" wx:key='' wx:for-index="idxs">
120 <view class="boxtop"> 107 <view class="boxtop">
121 <view class="boxtopleft"> 108 <view class="boxtopleft">
122 - 品牌简介 109 + {{item.name}}
123 </view> 110 </view>
124 - <view class="boxright">  
125 - <image src="{{url}}aicon_24x.png"></image> 111 + <view class="boxright" bindtap="showinfo" data-idx="{{idxs}}">
  112 + <image src="{{url}}aicon_53x.png" wx:if="{{item.show}}"></image>
  113 + <image src="{{url}}aicon_52x.png" wx:else></image>
126 </view> 114 </view>
127 </view> 115 </view>
128 116
129 - <view class="brandtext">  
130 - 湖北白云边集团(以下简称“集团”或“白云边集团”)是一家以酒业为龙头产业的多元化投资控股企业集团,总部位于湖北省武汉市。白云边集团下设7大战略业务单位,包括白酒、食品餐饮、钢铁制造、置业投资、酒店旅游、物流商贸、文化传播等。白云边集团的多元化业务具有良好的产业基础和市场竞争优势,其中白酒已建立行业领先地位。截止2017年,白云边集团总资产达80余亿元。 117 + <view class="brandtext" wx:if="{{item.show}}">
  118 + <block wx:for="{{artileList}}" wx:for-item="item" wx:for-index="idx" wx:key=''>
  119 + <block wx:if="{{idxs==idx}}">
  120 + <template is="wxParse" data="{{wxParseData:item}}" />
  121 + </block>
  122 + </block>
131 </view> 123 </view>
132 124
133 - <view class="brandimg">  
134 - <image src="{{url}}aicon_23@2x.png"></image>  
135 - </view>  
136 125
137 - </view>  
138 -  
139 - <view class="brandboxitem">  
140 - <view class="boxtop">  
141 - <view class="boxtopleft">  
142 - 品牌文化  
143 - </view>  
144 - <view class="boxright">  
145 - <image src="{{url}}aicon_24x.png"></image>  
146 - </view>  
147 - </view>  
148 126
  127 + </view>
149 128
150 - <view class="brandimg">  
151 - <image src="{{url}}aicon_23@2x.png"></image>  
152 - </view>  
153 129
154 - </view>  
155 130
156 </view> 131 </view>
157 132
@@ -159,27 +134,30 @@ @@ -159,27 +134,30 @@
159 134
160 <!-- 酿酒师 --> 135 <!-- 酿酒师 -->
161 136
162 -<view class="jiuhsi" wx:if="{{current==2}}"> 137 +<view class="jiuhsi" wx:elif="{{selectid==-3}}">
163 138
164 <view class="teacherhead"> 139 <view class="teacherhead">
165 <view class="teacherleft"> 140 <view class="teacherleft">
166 <view class="teacimg"> 141 <view class="teacimg">
167 - <image src="{{url}}aicon_77@2x.png"></image> 142 + <image src="{{jiushi.avatar}}"></image>
168 </view> 143 </view>
169 144
170 - <view class="teacname">徐强</view> 145 + <view class="teacname">{{jiushi.name}}</view>
171 <view class="teacgouimg"> 146 <view class="teacgouimg">
172 <image src="{{url}}aicon_20x.png"></image> 147 <image src="{{url}}aicon_20x.png"></image>
173 </view> 148 </view>
174 </view> 149 </view>
175 150
176 - <view class="atten"> 151 + <view class="atten" wx:if="{{jiushi.is_concern==0}}" bindtap="attenjiushi" data-id="{{jiushi.id}}">
177 关注 152 关注
178 </view> 153 </view>
  154 + <view class="atten" wx:if="{{jiushi.is_concern==1}}" bindtap="attenjiushi" data-id="{{jiushi.id}}">
  155 + 取消关注
  156 + </view>
179 </view> 157 </view>
180 158
181 <view class="wineimg"> 159 <view class="wineimg">
182 - <image src="{{url}}aicon_91x.png"></image> 160 + <image src="{{jiushi.thumb}}"></image>
183 </view> 161 </view>
184 162
185 <view class="niangjiubox"> 163 <view class="niangjiubox">
@@ -189,51 +167,48 @@ @@ -189,51 +167,48 @@
189 <view class="boxtopleft"> 167 <view class="boxtopleft">
190 基本信息 168 基本信息
191 </view> 169 </view>
192 - <view class="boxright">  
193 - <image src="{{url}}aicon_24x.png"></image> 170 + <view class="boxright" bindtap="jiushinfoshow">
  171 + <image src="{{url}}aicon_53x.png" wx:if="{{jiushishow}}"></image>
  172 + <image src="{{url}}aicon_52x.png" wx:else></image>
194 </view> 173 </view>
195 </view> 174 </view>
196 175
197 - <view class="brandtext"> 176 + <view class="brandtext" wx:if="{{jiushishow}}">
198 <view class="baisinfo"> 177 <view class="baisinfo">
199 <view class="basinfoleft">性别</view> 178 <view class="basinfoleft">性别</view>
200 - <view class="baisinforight">男</view> 179 + <view class="baisinforight" wx:if="{{jiushi.sex==1}}">男</view>
  180 + <view class="baisinforight" wx:if="{{jiushi.sex==2}}">女</view>
201 </view> 181 </view>
202 <view class="baisinfo"> 182 <view class="baisinfo">
203 <view class="basinfoleft">年龄</view> 183 <view class="basinfoleft">年龄</view>
204 - <view class="baisinforight">34</view> 184 + <view class="baisinforight">{{jiushi.age}}</view>
205 </view> 185 </view>
206 <view class="baisinfo"> 186 <view class="baisinfo">
207 <view class="basinfoleft">所属酒厂</view> 187 <view class="basinfoleft">所属酒厂</view>
208 - <view class="baisinforight">广东顺德酒厂</view> 188 + <view class="baisinforight">{{jiushi.company_name}}</view>
209 </view> 189 </view>
210 </view> 190 </view>
211 191
212 192
213 </view> 193 </view>
214 - <view class="brandboxitem"> 194 + <view class="brandboxitem" wx:for="{{jiushiarr}}" wx:key='' wx:for-index="idxs">
215 <view class="boxtop"> 195 <view class="boxtop">
216 <view class="boxtopleft"> 196 <view class="boxtopleft">
217 - 专业履历 197 + {{item.name}}
218 </view> 198 </view>
219 - <view class="boxright">  
220 - <image src="{{url}}aicon_24x.png"></image> 199 + <view class="boxright" bindtap="showjiushi" data-idx="{{idxs}}">
  200 + <image src="{{url}}aicon_53x.png" wx:if="{{item.show}}"></image>
  201 + <image src="{{url}}aicon_52x.png" wx:else></image>
221 </view> 202 </view>
222 </view> 203 </view>
223 204
224 - <view class="brandtext">  
225 - <view class="brandlsit">  
226 - 2009年接触葡萄酒。  
227 - </view>  
228 - <view class="brandlsit">  
229 - 2010年—2011年在郑大工学院和财经学院任教计算机3D设计教师。  
230 - </view>  
231 - <view class="brandlsit">  
232 - 2012年考取ESW葡萄酒中级品酒师证。  
233 - </view>  
234 - <view class="brandlsit">  
235 - 2012年至今在优传葡萄酒有限公司从事葡萄酒销售,酒会承办工作。同时从事企业礼仪茶培训。  
236 - </view> 205 + <view class="brandtext" wx:if="{{item.show}}">
  206 +
  207 + <block wx:for="{{artileList1}}" wx:for-item="item" wx:for-index="idx" wx:key=''>
  208 + <block wx:if="{{idxs==idx}}">
  209 + <template is="wxParse" data="{{wxParseData:item}}" />
  210 + </block>
  211 + </block>
237 212
238 213
239 214
@@ -243,47 +218,83 @@ @@ -243,47 +218,83 @@
243 218
244 </view> 219 </view>
245 220
246 - <view class="brandboxitem"> 221 +
  222 +
  223 + </view>
  224 +</view>
  225 +<!-- 专业品评 -->
  226 +<view class="jiuqiye" wx:elif="{{selectid==-4}}">
  227 + <view class="brandbox">
  228 + <view class="brandboxitem" wx:for="{{zhuanye}}" wx:key='' wx:for-index="idxs">
247 <view class="boxtop"> 229 <view class="boxtop">
248 <view class="boxtopleft"> 230 <view class="boxtopleft">
249 - 代表作品 231 + {{item.title}}
250 </view> 232 </view>
251 - <view class="boxright">  
252 - <image src="{{url}}aicon_24x.png"></image> 233 + <view class="boxright" bindtap="showzhuanye" data-idx="{{idxs}}">
  234 + <image src="{{url}}aicon_53x.png" wx:if="{{item.show}}"></image>
  235 + <image src="{{url}}aicon_52x.png" wx:else></image>
253 </view> 236 </view>
254 </view> 237 </view>
255 238
256 - <view class="brandtext">  
257 - <view class="brandlsit">  
258 - 2009年接触葡萄酒。  
259 - </view>  
260 - <view class="brandlsit">  
261 - 2010年—2011年在郑大工学院和财经学院任教计算机3D设计教师。  
262 - </view>  
263 - <view class="brandlsit">  
264 - 2012年考取ESW葡萄酒中级品酒师证。  
265 - </view>  
266 - <view class="brandlsit">  
267 - 2012年至今在优传葡萄酒有限公司从事葡萄酒销售,酒会承办工作。同时从事企业礼仪茶培训。  
268 - </view> 239 + <view class="brandtext" wx:if="{{item.show}}">
  240 + <block wx:for="{{artileList2}}" wx:for-item="item" wx:for-index="idx" wx:key=''>
  241 + <block wx:if="{{idxs==idx}}">
  242 + <template is="wxParse" data="{{wxParseData:item}}" />
  243 + </block>
  244 + </block>
  245 + </view>
269 246
270 247
271 248
  249 + </view>
  250 +
  251 +
272 252
  253 + </view>
  254 +
  255 +</view>
  256 +
  257 +<!-- 关键词 -->
  258 +
  259 +<view class="keyword" wx:elif="{{selectid==-5}}">
  260 + <view class="keyworditem" wx:for="{{jiben}}" wx:key="">{{item.content}}</view>
  261 +
  262 +</view>
  263 +
  264 +<view wx:else>
  265 + <view class="brandbox">
  266 + <view class="brandboxitem" wx:for="{{othercontent}}" wx:key='' wx:for-index="idxs">
  267 + <!-- <view class="boxtop">
  268 + <view class="boxtopleft">
  269 + {{item.name}}
  270 + </view>
  271 + <view class="boxright" bindtap="showinfo" data-idx="{{idxs}}">
  272 + <image src="{{url}}aicon_53x.png" wx:if="{{item.show}}"></image>
  273 + <image src="{{url}}aicon_52x.png" wx:else></image>
  274 + </view>
  275 + </view> -->
  276 +
  277 + <view class="brandtext" wx:if="{{item.show}}">
  278 + <block wx:for="{{artileList4}}" wx:for-item="item" wx:for-index="idx" wx:key=''>
  279 + <block wx:if="{{idxs==idx}}">
  280 + <template is="wxParse" data="{{wxParseData:item}}" />
  281 + </block>
  282 + </block>
273 </view> 283 </view>
274 284
275 285
  286 +
276 </view> 287 </view>
277 288
  289 +
  290 +
278 </view> 291 </view>
  292 +
279 </view> 293 </view>
280 294
281 -<!-- 关键词 --> 295 +<view class='pingjia' bindtap="evalute">
  296 + <image src="/img/aicon_29@2x.png"></image>
282 297
283 -<view class="keyword" wx:if="{{current==3}}">  
284 - <view class="keyworditem">基本参数</view>  
285 - <view class="keyworditem">基本参数</view>  
286 - <view class="keyworditem">基本参数</view>  
287 - <view class="keyworditem">基本参数</view>  
288 - <view class="keyworditem">基本参数</view> 298 + <view class="pingcount">{{wineinfo.comment_count}}</view>
  299 + <view class="pingname">评价</view>
289 </view> 300 </view>
@@ -18,6 +18,7 @@ page{ @@ -18,6 +18,7 @@ page{
18 background: #fff; 18 background: #fff;
19 } 19 }
20 .canleft{ 20 .canleft{
  21 + width:130rpx;
21 color:#999999; 22 color:#999999;
22 font-size: 26rpx; 23 font-size: 26rpx;
23 } 24 }
@@ -96,9 +97,74 @@ page{ @@ -96,9 +97,74 @@ page{
96 .slectpic{ 97 .slectpic{
97 width:128rpx; 98 width:128rpx;
98 text-align: center; 99 text-align: center;
99 - padding: 22rpx 0; 100 + padding: 10rpx 0;
100 box-sizing: border-box; 101 box-sizing: border-box;
101 background: #E81825; 102 background: #E81825;
102 color:#fff; 103 color:#fff;
103 border-radius:50rpx; 104 border-radius:50rpx;
  105 +}
  106 +.brandboxitem{
  107 + background: #fff;
  108 + padding-bottom: 20rpx!important;
  109 +}
  110 +.wujiaoimg{
  111 + width:26rpx;
  112 + height:24rpx;
  113 + font-size: 0;
  114 + margin-left:9rpx;
  115 +}
  116 +.wujiao{
  117 + display:flex;
  118 + align-items: center;
  119 + margin-left:195rpx;
  120 +}
  121 +.gaunfang{
  122 + display:flex;
  123 + align-items: center;
  124 + padding:31rpx 32rpx;
  125 + box-sizing: border-box;
  126 + background: #fff;
  127 + border-bottom:12rpx solid #F2F2F2;
  128 +}
  129 +.guanfangtitle{
  130 + color:#1A1A1A;
  131 + font-size:34rpx;
  132 + font-weight: bold;
  133 +}
  134 +.guanfang{
  135 + color:#1A1A1A;
  136 + font-size: 22rpx;
  137 + margin-left:9rpx;
  138 +}
  139 +.fen{
  140 + color:#666666;
  141 + font-size: 24rpx;
  142 + margin-left:17rpx;
  143 +}
  144 +.pingjia{
  145 + width:95rpx;
  146 + height:114rpx;
  147 + font-size: 0;
  148 + position: fixed;
  149 + bottom:42rpx;
  150 + right:35rpx;
  151 +}
  152 +.pingjia image{
  153 + width:100%;
  154 + height:100%;
  155 +}
  156 +.pingcount{
  157 + color:#FFFFFF;
  158 + font-size:24rpx;
  159 + position: fixed;
  160 + bottom:113rpx;
  161 + right:67rpx;
  162 +}
  163 +.pingname{
  164 + color:#FFFFFF;
  165 + font-size:24rpx;
  166 + position: fixed;
  167 + bottom:81rpx;
  168 + right:56rpx;
  169 +
104 } 170 }
@@ -28,8 +28,8 @@ Page({ @@ -28,8 +28,8 @@ Page({
28 this.setData({ 28 this.setData({
29 url: app.globalData.url 29 url: app.globalData.url
30 }) 30 })
31 -  
32 this.getsearchtext() 31 this.getsearchtext()
  32 +
33 }, 33 },
34 clear(){ 34 clear(){
35 console.log(3478734878) 35 console.log(3478734878)
@@ -39,12 +39,16 @@ Page({ @@ -39,12 +39,16 @@ Page({
39 // recordshow: true, 39 // recordshow: true,
40 40
41 }) 41 })
  42 +
  43 + this.getkeyword()
  44 +
  45 + this.getlist()
42 }, 46 },
43 //获取搜索内容 47 //获取搜索内容
44 getsearchtext(){ 48 getsearchtext(){
45 49
46 let that = this; 50 let that = this;
47 - let url = '/index/Index/search_default', params = { 51 + let url = 'index/Index/search_default', params = {
48 sort:that.data.select, 52 sort:that.data.select,
49 city:wx.getStorageSync('city') 53 city:wx.getStorageSync('city')
50 54
@@ -63,6 +67,13 @@ Page({ @@ -63,6 +67,13 @@ Page({
63 67
64 }) 68 })
65 }, 69 },
  70 + //酒展示
  71 + enterwine(e){
  72 + let id=e.currentTarget.dataset.id;
  73 + wx.navigateTo({
  74 + url: '/pages/homeblock/jiuzidian/jiuzidian?id='+id,
  75 + })
  76 + },
66 select(e){ 77 select(e){
67 this.setData({ 78 this.setData({
68 select:e.currentTarget.dataset.id, 79 select:e.currentTarget.dataset.id,
@@ -84,7 +95,7 @@ Page({ @@ -84,7 +95,7 @@ Page({
84 95
85 getlist(){ 96 getlist(){
86 let that = this; 97 let that = this;
87 - let url = '/index/Index/search', params = { 98 + let url = 'index/Index/search', params = {
88 sort: that.data.select, 99 sort: that.data.select,
89 keyword:that.data.keyword, 100 keyword:that.data.keyword,
90 page:that.data.page 101 page:that.data.page
@@ -95,17 +106,14 @@ Page({ @@ -95,17 +106,14 @@ Page({
95 searchlistarr:res.list 106 searchlistarr:res.list
96 }) 107 })
97 108
98 - let newsearchlistarr = that.data.searchlistarr;  
99 - for (var obj of newsearchlistarr){  
100 - obj.sel=false;  
101 -  
102 - }  
103 - that.setData({  
104 - searchlistarr: newsearchlistarr  
105 - })  
106 -  
107 - 109 + // let newsearchlistarr = that.data.searchlistarr;
  110 + // for (var obj of newsearchlistarr){
  111 + // obj.sel=false;
108 112
  113 + // }
  114 + // that.setData({
  115 + // searchlistarr: newsearchlistarr
  116 + // })
109 }).catch((err) => { 117 }).catch((err) => {
110 118
111 }) 119 })
@@ -115,21 +123,6 @@ Page({ @@ -115,21 +123,6 @@ Page({
115 collect(e){ 123 collect(e){
116 let that = this; 124 let that = this;
117 let id=e.currentTarget.dataset.id; 125 let id=e.currentTarget.dataset.id;
118 - let newsearchlistarr = this.data.searchlistarr;  
119 -  
120 - for (var obj of newsearchlistarr){  
121 - obj.sel = !obj.sel  
122 - if(obj.id==id){  
123 - // obj.sel=true  
124 - }else{  
125 - obj.sel = false  
126 - }  
127 - }  
128 - this.setData({  
129 - searchlistarr: newsearchlistarr  
130 - })  
131 -  
132 -  
133 let url = '/index/Common/favorite', params = { 126 let url = '/index/Common/favorite', params = {
134 sort: that.data.select, 127 sort: that.data.select,
135 id:id 128 id:id
@@ -141,6 +134,32 @@ Page({ @@ -141,6 +134,32 @@ Page({
141 icon:'none' 134 icon:'none'
142 }) 135 })
143 136
  137 + that.getlist()
  138 +
  139 +
  140 +
  141 + }).catch((err) => {
  142 +
  143 + })
  144 + },
  145 +
  146 + //关注和取消关注
  147 + attention(e){
  148 + let that = this;
  149 + let id = e.currentTarget.dataset.id;
  150 + let url = '/index/Common/concern', params = {
  151 + sort: 1,
  152 + id: id
  153 + }
  154 + app.post(url, params).then((res) => {
  155 + console.log(res);
  156 + wx.showToast({
  157 + title: res,
  158 + icon: 'none'
  159 + })
  160 +
  161 + that.getlist()
  162 +
144 163
145 164
146 }).catch((err) => { 165 }).catch((err) => {
@@ -196,6 +215,20 @@ Page({ @@ -196,6 +215,20 @@ Page({
196 215
197 this.getkeyword() 216 this.getkeyword()
198 }, 217 },
  218 + //跳页
  219 + jumpbrand(e){
  220 + let id=e.currentTarget.dataset.id
  221 + wx.navigateTo({
  222 + url: '/pages/homeblock/brandlist/brandlist?id='+id,
  223 + })
  224 + },
  225 + //酒企
  226 + jumpcompany(e){
  227 + let id = e.currentTarget.dataset.id
  228 + wx.navigateTo({
  229 + url: '/pages/homeblock/companyintro/companyintro?id=' + id,
  230 + })
  231 + },
199 /** 232 /**
200 * 生命周期函数--监听页面初次渲染完成 233 * 生命周期函数--监听页面初次渲染完成
201 */ 234 */
@@ -207,7 +240,8 @@ Page({ @@ -207,7 +240,8 @@ Page({
207 * 生命周期函数--监听页面显示 240 * 生命周期函数--监听页面显示
208 */ 241 */
209 onShow: function () { 242 onShow: function () {
210 - 243 + this.getlist()
  244 +
211 }, 245 },
212 246
213 /** 247 /**
@@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
46 <view class="textbox"> 46 <view class="textbox">
47 47
48 <view class="seahead" > 48 <view class="seahead" >
49 - <view class="searword" wx:for="{{list}}" wx:key="">{{item.name}}</view> 49 + <view class="searword" wx:for="{{list}}" wx:key="" bindtap="enterwine" data-id="{{item.id}}">{{item.name}}</view>
50 50
51 </view> 51 </view>
52 52
@@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
83 83
84 <view class="jiupin" wx:if="{{select==1}}"> 84 <view class="jiupin" wx:if="{{select==1}}">
85 85
86 - <view class="searchitem" wx:for="{{searchlistarr}}" wx:key=''> 86 + <view class="searchitem" wx:for="{{searchlistarr}}" wx:key='' bindtap="jumpbrand" data-id="{{item.id}}">
87 <view class="searchitemleft"> 87 <view class="searchitemleft">
88 <view class="itemleftimg"> 88 <view class="itemleftimg">
89 <image src="{{item.logo}}"></image> 89 <image src="{{item.logo}}"></image>
@@ -101,351 +101,69 @@ @@ -101,351 +101,69 @@
101 </view> 101 </view>
102 102
103 <view class="starimg" catchtap="collect" data-id="{{item.id}}"> 103 <view class="starimg" catchtap="collect" data-id="{{item.id}}">
104 - <image src="{{url}}aicon_10x.png" wx:if="{{item.sel}}"></image> 104 + <image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
105 <image src="{{url}}aicon_09x.png" wx:else></image> 105 <image src="{{url}}aicon_09x.png" wx:else></image>
106 106
107 </view> 107 </view>
108 108
109 </view> 109 </view>
110 - <!-- <view class="searchitem">  
111 - <view class="searchitemleft">  
112 - <view class="itemleftimg">  
113 - <image src="{{url}}aicon_11@2x.png"></image>  
114 - </view>  
115 -  
116 - <view class="itemiddle">  
117 - <view class="itemidelename">泸州迎宾酒</view>  
118 - <view class="nambottom">  
119 - <text class="namebottomitem">53°</text>  
120 - <text class="namebottomitem">浓香型</text>  
121 - <text class="namebottomitem">53°</text>  
122 - <text class="namebottomitem">53°</text>  
123 - </view>  
124 - </view>  
125 - </view>  
126 -  
127 - <view class="starimg">  
128 -  
129 -  
130 - <image src="{{url}}aicon_09x.png"></image>  
131 - </view>  
132 -  
133 - </view>  
134 - <view class="searchitem">  
135 - <view class="searchitemleft">  
136 - <view class="itemleftimg">  
137 - <image src="{{url}}aicon_11@2x.png"></image>  
138 - </view>  
139 -  
140 - <view class="itemiddle">  
141 - <view class="itemidelename">泸州迎宾酒</view>  
142 - <view class="nambottom">  
143 - <text class="namebottomitem">53°</text>  
144 - <text class="namebottomitem">浓香型</text>  
145 - <text class="namebottomitem">53°</text>  
146 - <text class="namebottomitem">53°</text>  
147 - </view>  
148 - </view>  
149 - </view>  
150 -  
151 - <view class="starimg">  
152 -  
153 -  
154 - <image src="{{url}}aicon_09x.png"></image>  
155 - </view>  
156 -  
157 - </view>  
158 - <view class="searchitem">  
159 - <view class="searchitemleft">  
160 - <view class="itemleftimg">  
161 - <image src="{{url}}aicon_11@2x.png"></image>  
162 - </view>  
163 -  
164 - <view class="itemiddle">  
165 - <view class="itemidelename">泸州迎宾酒</view>  
166 - <view class="nambottom">  
167 - <text class="namebottomitem">53°</text>  
168 - <text class="namebottomitem">浓香型</text>  
169 - <text class="namebottomitem">53°</text>  
170 - <text class="namebottomitem">53°</text>  
171 - </view>  
172 - </view>  
173 - </view>  
174 -  
175 - <view class="starimg">  
176 -  
177 -  
178 - <image src="{{url}}aicon_09x.png"></image>  
179 - </view>  
180 -  
181 - </view>  
182 - <view class="searchitem">  
183 - <view class="searchitemleft">  
184 - <view class="itemleftimg">  
185 - <image src="{{url}}aicon_11@2x.png"></image>  
186 - </view>  
187 -  
188 - <view class="itemiddle">  
189 - <view class="itemidelename">泸州迎宾酒</view>  
190 - <view class="nambottom">  
191 - <text class="namebottomitem">53°</text>  
192 - <text class="namebottomitem">浓香型</text>  
193 - <text class="namebottomitem">53°</text>  
194 - <text class="namebottomitem">53°</text>  
195 - </view>  
196 - </view>  
197 - </view>  
198 -  
199 - <view class="starimg">  
200 -  
201 - <image src="{{url}}aicon_09x.png"></image>  
202 - </view>  
203 -  
204 - </view> --> 110 +
205 </view> 111 </view>
206 112
207 <view class="brand" wx:if="{{select==2}}"> 113 <view class="brand" wx:if="{{select==2}}">
208 114
209 - <view class="searchitem"> 115 + <view class="searchitem" wx:for="{{searchlistarr}}" wx:key='' bindtap="jumpbrand" data-id="{{item.id}}">
210 <view class="searchitemleft"> 116 <view class="searchitemleft">
211 <view class="branditemleftimg"> 117 <view class="branditemleftimg">
212 <image src="{{url}}aicon_12@2x.png"></image> 118 <image src="{{url}}aicon_12@2x.png"></image>
213 </view> 119 </view>
214 120
215 <view class="itemiddle"> 121 <view class="itemiddle">
216 - <view class="itemidelename">泸州福</view>  
217 - <view class="nambottom">  
218 - <text class="namebottomitem">53°</text>  
219 - <text class="namebottomitem">浓香型</text>  
220 - <text class="namebottomitem">53°</text>  
221 - <text class="namebottomitem">53°</text>  
222 - </view>  
223 - </view>  
224 - </view>  
225 -  
226 - <view class="starimg">  
227 - <!-- aicon_010x.png -->  
228 -  
229 - <image src="{{url}}aicon_09x.png"></image>  
230 - </view>  
231 -  
232 - </view>  
233 - <view class="searchitem">  
234 - <view class="searchitemleft">  
235 - <view class="itemleftimg">  
236 - <image src="{{url}}aicon_11@2x.png"></image>  
237 - </view>  
238 -  
239 - <view class="itemiddle">  
240 - <view class="itemidelename">泸州迎宾酒</view>  
241 - <view class="nambottom">  
242 - <text class="namebottomitem">53°</text>  
243 - <text class="namebottomitem">浓香型</text>  
244 - <text class="namebottomitem">53°</text>  
245 - <text class="namebottomitem">53°</text>  
246 - </view>  
247 - </view>  
248 - </view>  
249 -  
250 - <view class="starimg">  
251 - <!-- aicon_010x.png -->  
252 -  
253 - <image src="{{url}}aicon_09x.png"></image>  
254 - </view>  
255 -  
256 - </view>  
257 - <view class="searchitem">  
258 - <view class="searchitemleft">  
259 - <view class="itemleftimg">  
260 - <image src="{{url}}aicon_11@2x.png"></image>  
261 - </view>  
262 -  
263 - <view class="itemiddle">  
264 - <view class="itemidelename">泸州迎宾酒</view>  
265 - <view class="nambottom">  
266 - <text class="namebottomitem">53°</text>  
267 - <text class="namebottomitem">浓香型</text>  
268 - <text class="namebottomitem">53°</text>  
269 - <text class="namebottomitem">53°</text>  
270 - </view>  
271 - </view>  
272 - </view>  
273 -  
274 - <view class="starimg">  
275 - <!-- aicon_010x.png -->  
276 -  
277 - <image src="{{url}}aicon_09x.png"></image>  
278 - </view>  
279 -  
280 - </view>  
281 - <view class="searchitem">  
282 - <view class="searchitemleft">  
283 - <view class="itemleftimg">  
284 - <image src="{{url}}aicon_11@2x.png"></image>  
285 - </view>  
286 -  
287 - <view class="itemiddle">  
288 - <view class="itemidelename">泸州迎宾酒</view>  
289 - <view class="nambottom">  
290 - <text class="namebottomitem">53°</text>  
291 - <text class="namebottomitem">浓香型</text>  
292 - <text class="namebottomitem">53°</text>  
293 - <text class="namebottomitem">53°</text>  
294 - </view>  
295 - </view>  
296 - </view>  
297 -  
298 - <view class="starimg">  
299 - <!-- aicon_010x.png -->  
300 -  
301 - <image src="{{url}}aicon_09x.png"></image>  
302 - </view>  
303 -  
304 - </view>  
305 - <view class="searchitem">  
306 - <view class="searchitemleft">  
307 - <view class="itemleftimg">  
308 - <image src="{{url}}aicon_11@2x.png"></image>  
309 - </view>  
310 -  
311 - <view class="itemiddle">  
312 - <view class="itemidelename">泸州迎宾酒</view> 122 + <view class="itemidelename">{{item.name}}</view>
313 <view class="nambottom"> 123 <view class="nambottom">
314 - <text class="namebottomitem">53°</text>  
315 - <text class="namebottomitem">浓香型</text>  
316 - <text class="namebottomitem">53°</text>  
317 - <text class="namebottomitem">53°</text> 124 + <text class="namebottomitem">{{item.sort_name}}</text>
  125 + <text class="namebottomitem">{{item.country}}</text>
  126 + <text class="namebottomitem">{{item.city}}</text>
  127 + <text class="namebottomitem">{{item.odor_name}}</text>
318 </view> 128 </view>
319 </view> 129 </view>
320 </view> 130 </view>
321 131
322 - <view class="starimg">  
323 - <!-- aicon_010x.png --> 132 + <view class="starimg" catchtap="collect" data-id="{{item.id}}">
  133 +
324 134
325 - <image src="{{url}}aicon_09x.png"></image> 135 + <image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
  136 + <image src="{{url}}aicon_09x.png" wx:else></image>
326 </view> 137 </view>
327 138
328 </view> 139 </view>
  140 +
329 </view> 141 </view>
330 142
331 <view class="brand" wx:if="{{select==3}}"> 143 <view class="brand" wx:if="{{select==3}}">
332 144
333 - <view class="searchitem"> 145 + <view class="searchitem" wx:for="{{searchlistarr}}" wx:key='' bindtap="jumpcompany" data-id="{{item.id}}">
334 <view class="searchitemleft"> 146 <view class="searchitemleft">
335 <view class="jiuqiimg"> 147 <view class="jiuqiimg">
336 <image src="{{url}}aicon_13@2x.png"></image> 148 <image src="{{url}}aicon_13@2x.png"></image>
337 </view> 149 </view>
338 150
339 <view class="itemiddle"> 151 <view class="itemiddle">
340 - <view class="itemidelename">泸州国粹酒业有限公司</view>  
341 - <view class="nambottom">  
342 - <text class="namebottomitem">53°</text>  
343 - <text class="namebottomitem">浓香型</text>  
344 - <text class="namebottomitem">53°</text>  
345 - <text class="namebottomitem">53°</text>  
346 - </view>  
347 - </view>  
348 - </view>  
349 -  
350 - <view class="atten">关注</view>  
351 -  
352 - </view>  
353 - <view class="searchitem">  
354 - <view class="searchitemleft">  
355 - <view class="itemleftimg">  
356 - <image src="{{url}}aicon_11@2x.png"></image>  
357 - </view>  
358 -  
359 - <view class="itemiddle">  
360 - <view class="itemidelename">泸州迎宾酒</view>  
361 - <view class="nambottom">  
362 - <text class="namebottomitem">53°</text>  
363 - <text class="namebottomitem">浓香型</text>  
364 - <text class="namebottomitem">53°</text>  
365 - <text class="namebottomitem">53°</text>  
366 - </view>  
367 - </view>  
368 - </view>  
369 -  
370 - <view class="starimg">  
371 - <!-- aicon_010x.png -->  
372 -  
373 - <image src="{{url}}aicon_09x.png"></image>  
374 - </view>  
375 -  
376 - </view>  
377 - <view class="searchitem">  
378 - <view class="searchitemleft">  
379 - <view class="itemleftimg">  
380 - <image src="{{url}}aicon_11@2x.png"></image>  
381 - </view>  
382 -  
383 - <view class="itemiddle">  
384 - <view class="itemidelename">泸州迎宾酒</view>  
385 - <view class="nambottom">  
386 - <text class="namebottomitem">53°</text>  
387 - <text class="namebottomitem">浓香型</text>  
388 - <text class="namebottomitem">53°</text>  
389 - <text class="namebottomitem">53°</text>  
390 - </view>  
391 - </view>  
392 - </view>  
393 -  
394 - <view class="starimg">  
395 - <!-- aicon_010x.png -->  
396 -  
397 - <image src="{{url}}aicon_09x.png"></image>  
398 - </view>  
399 -  
400 - </view>  
401 - <view class="searchitem">  
402 - <view class="searchitemleft">  
403 - <view class="itemleftimg">  
404 - <image src="{{url}}aicon_11@2x.png"></image>  
405 - </view>  
406 -  
407 - <view class="itemiddle">  
408 - <view class="itemidelename">泸州迎宾酒</view>  
409 - <view class="nambottom">  
410 - <text class="namebottomitem">53°</text>  
411 - <text class="namebottomitem">浓香型</text>  
412 - <text class="namebottomitem">53°</text>  
413 - <text class="namebottomitem">53°</text>  
414 - </view>  
415 - </view>  
416 - </view>  
417 -  
418 - <view class="starimg">  
419 - <!-- aicon_010x.png -->  
420 -  
421 - <image src="{{url}}aicon_09x.png"></image>  
422 - </view>  
423 -  
424 - </view>  
425 - <view class="searchitem">  
426 - <view class="searchitemleft">  
427 - <view class="itemleftimg">  
428 - <image src="{{url}}aicon_11@2x.png"></image>  
429 - </view>  
430 -  
431 - <view class="itemiddle">  
432 - <view class="itemidelename">泸州迎宾酒</view> 152 + <view class="itemidelename">{{item.name}}</view>
433 <view class="nambottom"> 153 <view class="nambottom">
434 - <text class="namebottomitem">53°</text>  
435 - <text class="namebottomitem">浓香型</text>  
436 - <text class="namebottomitem">53°</text>  
437 - <text class="namebottomitem">53°</text> 154 + <text class="namebottomitem">{{item.country}}</text>
  155 + <text class="namebottomitem">{{item.city}}</text>
  156 + <text class="namebottomitem">{{item.sort_name}}</text>
  157 + <text class="namebottomitem">{{item.concern_count}}关注</text>
438 </view> 158 </view>
439 </view> 159 </view>
440 </view> 160 </view>
441 161
442 - <view class="starimg">  
443 - <!-- aicon_010x.png -->  
444 -  
445 - <image src="{{url}}aicon_09x.png"></image>  
446 - </view> 162 + <view class="atten" wx:if="{{item.is_concern==1}}" data-id="{{item.id}}" catchtap="attention">取消关注</view>
  163 + <view class="atten" data-id="{{item.id}}" wx:else catchtap="attention">关注</view>
447 164
448 </view> 165 </view>
  166 +
449 </view> 167 </view>
450 168
451 </view> 169 </view>
@@ -167,6 +167,9 @@ image{ @@ -167,6 +167,9 @@ image{
167 padding: 0 20rpx; 167 padding: 0 20rpx;
168 border-right:1rpx solid #f5f5f5; 168 border-right:1rpx solid #f5f5f5;
169 } 169 }
  170 +.namebottomitem:last-child{
  171 + border-right:none;
  172 + }
170 .branditemleftimg{ 173 .branditemleftimg{
171 width:80rpx; 174 width:80rpx;
172 height:80rpx; 175 height:80rpx;
@@ -177,7 +180,14 @@ image{ @@ -177,7 +180,14 @@ image{
177 width:80rpx; 180 width:80rpx;
178 height:80rpx; 181 height:80rpx;
179 } 182 }
180 - .nambottom .namebottomitem:first-child{  
181 - padding-left: 0;  
182 - }  
183 -  
  183 + .noatten{
  184 + width: 100rpx;
  185 + height: 50rpx;
  186 + background: #999;
  187 + border-radius: 2rpx;
  188 + font-size: 26rpx;
  189 + color: #fff;
  190 + text-align: center;
  191 + line-height: 50rpx;
  192 +
  193 + }
@@ -7,7 +7,9 @@ Page({ @@ -7,7 +7,9 @@ Page({
7 * 页面的初始数据 7 * 页面的初始数据
8 */ 8 */
9 data: { 9 data: {
10 - url:"" 10 + url:"",
  11 + id:'',
  12 + shipaiarr:[]
11 }, 13 },
12 14
13 /** 15 /**
@@ -15,8 +17,31 @@ Page({ @@ -15,8 +17,31 @@ Page({
15 */ 17 */
16 onLoad: function (options) { 18 onLoad: function (options) {
17 this.setData({ 19 this.setData({
18 - url: app.globalData.url 20 + url: app.globalData.url,
  21 + id:options.wineid
19 }) 22 })
  23 +
  24 + this.getshipai()
  25 + },
  26 +
  27 + //获取官图
  28 + getshipai(){
  29 + let that = this;
  30 + let url = 'index/Wine/comment_images',
  31 + params = {
  32 + wine_id: that.data.id,
  33 +
  34 + }
  35 + app.post(url, params).then((res) => {
  36 + console.log(res);
  37 + that.setData({
  38 + shipaiarr:res.list
  39 + })
  40 +
  41 + }).catch((err) => {
  42 +
  43 + })
  44 +
20 }, 45 },
21 46
22 /** 47 /**
1 <view class="containerbox"> 1 <view class="containerbox">
2 - <view class="boxitem"> 2 + <view class="boxitem" wx:for="{{shipaiarr}}" wx:key=''>
3 <view class="itemimg"> 3 <view class="itemimg">
4 - <image src="{{url}}aicon_90x.png"></image> 4 + <image src="{{item.url}}"></image>
5 </view> 5 </view>
6 6
7 <view class="itembottom"> 7 <view class="itembottom">
8 <view class="bottomtop"> 8 <view class="bottomtop">
9 <view class="bottomleft"> 9 <view class="bottomleft">
10 - <image src="{{url}}aicon_45@2x.png"></image> 10 + <image src="{{item.avatar}}"></image>
11 </view> 11 </view>
12 - <text class="leftname">小叶子实打实</text> 12 + <text class="leftname">{{item.user_nickname}}</text>
13 </view> 13 </view>
14 <view class="bottomxia"> 14 <view class="bottomxia">
15 <view class="xiaimg"> 15 <view class="xiaimg">
16 <image src="{{url}}aicon_47x.png"></image> 16 <image src="{{url}}aicon_47x.png"></image>
17 17
18 </view> 18 </view>
19 - <text class="zannum">6.2k</text>  
20 - </view>  
21 -  
22 - </view>  
23 - </view>  
24 - <view class="boxitem">  
25 - <view class="itemimg">  
26 - <image src="{{url}}aicon_90x.png"></image>  
27 - </view>  
28 -  
29 - <view class="itembottom">  
30 - <view class="bottomtop">  
31 - <view class="bottomleft">  
32 - <image src="{{url}}aicon_45@2x.png"></image>  
33 - </view>  
34 - <text class="leftname">小叶子实打实</text>  
35 - </view>  
36 - <view class="bottomxia">  
37 - <view class="xiaimg">  
38 - <image src="{{url}}aicon_47x.png"></image>  
39 - </view>  
40 - <text class="zannum">6.2k</text>  
41 - </view>  
42 - </view>  
43 - </view>  
44 - <view class="boxitem">  
45 - <view class="itemimg">  
46 - <image src="{{url}}aicon_90x.png"></image>  
47 - </view>  
48 -  
49 - <view class="itembottom">  
50 - <view class="bottomtop">  
51 - <view class="bottomleft">  
52 - <image src="{{url}}aicon_45@2x.png"></image>  
53 - </view>  
54 - <text class="leftname">小叶子实打实</text>  
55 - </view>  
56 - <view class="bottomxia">  
57 - <view class="xiaimg">  
58 - <image src="{{url}}aicon_47x.png"></image>  
59 -  
60 - </view>  
61 - <text class="zannum">6.2k</text>  
62 - </view>  
63 -  
64 - </view>  
65 - </view>  
66 - <view class="boxitem">  
67 - <view class="itemimg">  
68 - <image src="{{url}}aicon_90x.png"></image>  
69 - </view>  
70 -  
71 - <view class="itembottom">  
72 - <view class="bottomtop">  
73 - <view class="bottomleft">  
74 - <image src="{{url}}aicon_45@2x.png"></image>  
75 - </view>  
76 - <text class="leftname">小叶子实打实</text>  
77 - </view>  
78 - <view class="bottomxia">  
79 - <view class="xiaimg">  
80 - <image src="{{url}}aicon_47x.png"></image>  
81 -  
82 - </view>  
83 - <text class="zannum">6.2k</text> 19 + <text class="zannum">{{item.good_count}}</text>
84 </view> 20 </view>
85 21
86 </view> 22 </view>
87 </view> 23 </view>
  24 +
88 </view> 25 </view>
@@ -27,6 +27,9 @@ page{ @@ -27,6 +27,9 @@ page{
27 font-size: 0; 27 font-size: 0;
28 border-radius: 50%; 28 border-radius: 50%;
29 } 29 }
  30 +.bottomleft image{
  31 + border-radius:50%;
  32 +}
30 .leftname{ 33 .leftname{
31 color:#666666; 34 color:#666666;
32 font-size: 28rpx; 35 font-size: 28rpx;
1 // pages/homeblock/shortvideo/shortvideo.js 1 // pages/homeblock/shortvideo/shortvideo.js
  2 +const app=getApp()
2 Page({ 3 Page({
3 4
4 /** 5 /**
5 * 页面的初始数据 6 * 页面的初始数据
6 */ 7 */
7 data: { 8 data: {
8 - 9 + id:'',
  10 + page:1,
  11 + list:[],
  12 + video:'',
  13 + date:''
9 }, 14 },
10 15
11 /** 16 /**
12 * 生命周期函数--监听页面加载 17 * 生命周期函数--监听页面加载
13 */ 18 */
14 onLoad: function (options) { 19 onLoad: function (options) {
  20 + this.setData({
  21 + id:options.wineid
  22 + })
  23 +
  24 + this.getshortvideo()
  25 + },
  26 + //获取短视频
  27 + getshortvideo(){
  28 + let that = this;
  29 + let url = 'index/Wine/comment_video',
  30 + params = {
  31 + wine_id: that.data.id,
  32 + page:that.data.page
  33 +
  34 + }
  35 + app.post(url, params).then((res) => {
  36 + console.log(res);
  37 + that.setData({
  38 + list: res.list,
  39 + video: res.video
  40 + })
  41 +
  42 + let newtime = res.video.create_time;
  43 +
  44 + that.formatDate(newtime)
15 45
  46 +
  47 +
  48 +
  49 + }).catch((err) => {
  50 +
  51 + })
16 }, 52 },
17 53
  54 +
  55 + formatDate(datetime) {
  56 + // 获取年月日时分秒值 slice(-2)过滤掉大于10日期前面的0
  57 + var date = new Date(datetime * 1000)
  58 + var Y = date.getFullYear() ;
  59 + var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) ;
  60 + var D = (date.getDate() + 1 < 10 ? '0' + (date.getDate()) : date.getDate())
  61 + var h = date.getHours() + ':';
  62 + var m = date.getMinutes() + ':';
  63 + var s = date.getSeconds();
  64 + // 拼接
  65 + var result = Y + "-" + M + "-" + D
  66 + console.log(result)
  67 + this.setData({
  68 + date:result
  69 + })
  70 + // 返回
  71 + return result;
  72 + },
18 /** 73 /**
19 * 生命周期函数--监听页面初次渲染完成 74 * 生命周期函数--监听页面初次渲染完成
20 */ 75 */
1 -<view class="biaozhuantitle">广告片</view> 1 +<view class="biaozhuantitle">{{video.name}}</view>
2 2
3 3
4 -<video src="/video/vi.mp4" controls class="video" object-fit="fill"></video> 4 +<video src="{{video.url}}" controls class="video" object-fit="fill"></video>
5 <view class="bofangnum"> 5 <view class="bofangnum">
6 <view class="bofangleft"> 6 <view class="bofangleft">
7 - 12.5w次播放 7 + {{video.times}}次播放
8 </view> 8 </view>
9 - <view class="bofangright">2019-02-26</view> 9 + <view class="bofangright">{{date}}</view>
10 </view> 10 </view>
11 11
12 12
13 <view class="biaozhuantitle xiaovideo">小视频</view> 13 <view class="biaozhuantitle xiaovideo">小视频</view>
14 <view class="shortvideobox"> 14 <view class="shortvideobox">
15 - <view class="videoitem">  
16 - <video src="/video/vi.mp4" class="itemvid" controls object-fit="fill"></video> 15 + <view class="videoitem" wx:for='{{list}}' wx:key=''>
  16 + <video src="{{item.video}}" class="itemvid" controls object-fit="fill"></video>
17 17
18 - <view class="videoittitle">春节大团圆,喝这真的喝这真的喝这真的</view> 18 + <view class="videoittitle">{{item.content}}</view>
19 <view class=""> 19 <view class="">
20 20
21 </view> 21 </view>
22 </view> 22 </view>
23 - <view class="videoitem"> 23 + <!-- <view class="videoitem">
24 <video src="/video/vi.mp4" class="itemvid" controls object-fit="fill"></video> 24 <video src="/video/vi.mp4" class="itemvid" controls object-fit="fill"></video>
25 </view> 25 </view>
26 <view class="videoitem"> 26 <view class="videoitem">
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 </view> 28 </view>
29 <view class="videoitem"> 29 <view class="videoitem">
30 <video src="/video/vi.mp4" class="itemvid" controls object-fit="fill"></video> 30 <video src="/video/vi.mp4" class="itemvid" controls object-fit="fill"></video>
31 - </view> 31 + </view> -->
32 32
33 33
34 34
1 // pages/homeblock/zhinengselect/zhinengselect.js 1 // pages/homeblock/zhinengselect/zhinengselect.js
2 -const app=getApp() 2 +const app = getApp()
3 Page({ 3 Page({
4 4
5 /** 5 /**
6 * 页面的初始数据 6 * 页面的初始数据
7 */ 7 */
8 data: { 8 data: {
9 - url:'',  
10 - navarr:[{  
11 - name:'用途'  
12 - },  
13 - {  
14 - name: '用途' 9 + url: '',
  10 + navarr: [{
  11 + name: '用途',
  12 + sel: false,
  13 + type: 1
15 }, 14 },
  15 +
16 { 16 {
17 - name: '价格' 17 + name: '价格',
  18 + sel: false,
  19 + type: 2
18 }, 20 },
19 { 21 {
20 - name: '包装' 22 + name: '包装',
  23 + sel: false,
  24 + type: 3
21 }, 25 },
22 { 26 {
23 - name: '产区' 27 + name: '产区',
  28 + sel: false,
  29 + type: 4
24 }, { 30 }, {
25 - name: '香型' 31 + name: '香型',
  32 + sel: false,
  33 + type: 5
26 }, 34 },
27 { 35 {
28 - name: '评分'  
29 - }],  
30 -  
31 - current:0 36 + name: '评分',
  37 + sel: false,
  38 + type: 6
  39 + }
  40 + ],
  41 +
  42 + current: 0,
  43 + zhinengwrap: false,
  44 + citychose: false,
  45 + use_id: '',
  46 + odor_id: '',
  47 + package_id: '',
  48 + city: '',
  49 + score: '',
  50 + more: '',
  51 + page: '',
  52 + type: '',
  53 + zhinengarr: [],
  54 + zhinenglist: [],
  55 + page:1
32 }, 56 },
33 57
34 /** 58 /**
35 * 生命周期函数--监听页面加载 59 * 生命周期函数--监听页面加载
36 */ 60 */
37 - onLoad: function (options) { 61 + onLoad: function(options) {
  62 + let that = this;
38 this.setData({ 63 this.setData({
39 url: app.globalData.url 64 url: app.globalData.url
40 }) 65 })
  66 +
  67 +
  68 + this.getshaicontent()
  69 +
  70 + this.getmorenconetent();
  71 +
  72 + },
  73 + select(e) {
  74 +
  75 + let that = this;
  76 +
  77 + let index = e.currentTarget.dataset.idx;
  78 + let type = e.currentTarget.dataset.type;
  79 + this.setData({
  80 + type: type,
  81 +
  82 + })
  83 +
  84 +
  85 + let newnavarr = this.data.navarr;
  86 + for (var i = 0; i < newnavarr.length; i++) {
  87 + if (i == index) {
  88 + newnavarr[i].sel = !newnavarr[i].sel;
  89 +
  90 + if (type == 4) {
  91 + if (newnavarr[i].sel == true) {
  92 + console.log(999)
  93 + this.setData({
  94 + citychose: true,
  95 + zhinengwrap: false
  96 +
  97 + })
  98 +
  99 + } else {
  100 + this.setData({
  101 + citychose: false,
  102 + zhinengwrap: false
  103 +
  104 + })
  105 + }
  106 + } else {
  107 + if (newnavarr[i].sel == true) {
  108 + console.log(999)
  109 + this.setData({
  110 + citychose: false,
  111 + zhinengwrap: true
  112 +
  113 + })
  114 +
  115 + } else {
  116 + this.setData({
  117 + citychose: false,
  118 + zhinengwrap: false
  119 +
  120 + })
  121 + }
  122 + }
  123 +
  124 + } else {
  125 + newnavarr[i].sel = false
  126 + }
  127 +
  128 +
  129 + }
  130 +
  131 +
  132 +
  133 + this.setData({
  134 + navarr: newnavarr
  135 + })
  136 +
  137 +
  138 +
  139 + this.getshaicontent();
  140 + this.getmorenconetent();
  141 +
  142 + let newzhinengarr1 = that.data.zhinengarr;
  143 + console.log(342347)
  144 + console.log(that.data.type);
  145 + console.log(newzhinengarr1)
  146 + // for (var obj of newzhinengarr1) {
  147 + // if (that.data.type == 1) {
  148 + // console.log(this.data.use_id)
  149 + // if (obj.id = this.data.use_id) {
  150 + // obj.sel = true
  151 + // }
  152 + // this.setData({
  153 + // zhinengarr: newzhinengarr1
  154 + // })
  155 + // } else if (that.data.type == 3) {
  156 + // if (obj.id = this.data.package_id) {
  157 + // obj.sel = true
  158 + // }
  159 + // this.setData({
  160 + // zhinengarr: newzhinengarr1
  161 + // })
  162 + // } else if (that.data.type == 4) {
  163 + // if (obj.city = this.data.city) {
  164 + // obj.sel = true
  165 + // }
  166 + // this.setData({
  167 + // zhinengarr: newzhinengarr1
  168 + // })
  169 + // } else if (that.data.type == 5) {
  170 + // if (obj.id = this.data.odor_id) {
  171 + // obj.sel = true
  172 + // }
  173 + // this.setData({
  174 + // zhinengarr: newzhinengarr1
  175 + // })
  176 + // }
  177 + // }
  178 +
  179 + },
  180 + //隐藏智能筛选
  181 + hidezhineng() {
  182 + this.setData({
  183 + zhinengwrap: false
  184 + })
  185 +
  186 + let newnavarr = this.data.navarr;
  187 + for (var obj of newnavarr) {
  188 + obj.sel = false
  189 + }
  190 +
  191 + this.setData({
  192 + navarr: newnavarr
  193 + })
  194 +
  195 + },
  196 + hide() {
  197 + this.setData({
  198 + citychose: false
  199 + })
  200 +
  201 + let newnavarr = this.data.navarr;
  202 + for (var obj of newnavarr) {
  203 + obj.sel = false
  204 + }
  205 +
  206 + this.setData({
  207 + navarr: newnavarr
  208 + })
  209 + },
  210 + //获取筛选内容
  211 + getshaicontent() {
  212 + let that = this;
  213 + let url = 'index/Filter/filter',
  214 + params = {
  215 +
  216 + }
  217 + app.post(url, params).then((res) => {
  218 + console.log(res);
  219 +
  220 +
  221 + if (that.data.type == 1) {
  222 + that.setData({
  223 +
  224 + zhinengarr: res.use
  225 + })
  226 +
  227 + let newzhinengarr = that.data.zhinengarr;
  228 + for (var obj of newzhinengarr) {
  229 + obj.sel = false
  230 + }
  231 +
  232 + that.setData({
  233 + zhinengarr: newzhinengarr
  234 + })
  235 +
  236 + let newzhinengarr1 = that.data.zhinengarr;
  237 + for (var obj of newzhinengarr1) {
  238 + if (obj.id == that.data.use_id) {
  239 + obj.sel = true
  240 + }
  241 + }
  242 +
  243 +
  244 + that.setData({
  245 + zhinengarr: newzhinengarr1
  246 + })
  247 +
  248 +
  249 + } else if (that.data.type == 2) {
  250 + that.setData({
  251 + zhinengarr: res.price
  252 + })
  253 +
  254 + let newzhinengarr = that.data.zhinengarr;
  255 + for (var obj of newzhinengarr) {
  256 + obj.sel = false
  257 + }
  258 +
  259 + that.setData({
  260 + zhinengarr: newzhinengarr
  261 + })
  262 +
  263 +
  264 +
  265 +
  266 + } else if (that.data.type == 3) {
  267 + that.setData({
  268 +
  269 + zhinengarr: res.packages
  270 + })
  271 +
  272 + let newzhinengarr = that.data.zhinengarr;
  273 + for (var obj of newzhinengarr) {
  274 + obj.sel = false
  275 + }
  276 +
  277 + that.setData({
  278 + zhinengarr: newzhinengarr
  279 + })
  280 +
  281 +
  282 + let newzhinengarr1 = that.data.zhinengarr;
  283 + for (var obj of newzhinengarr1) {
  284 + if (obj.id == that.data.package_id) {
  285 + obj.sel = true
  286 + }
  287 + }
  288 +
  289 +
  290 + that.setData({
  291 + zhinengarr: newzhinengarr1
  292 + })
  293 + } else if (that.data.type == 4) {
  294 + that.setData({
  295 + zhinengarr: res.city
  296 + })
  297 +
  298 +
  299 + let newzhinengarr = that.data.zhinengarr;
  300 + for (var obj of newzhinengarr) {
  301 + obj.sel = false
  302 + }
  303 +
  304 + that.setData({
  305 + zhinengarr: newzhinengarr
  306 + })
  307 +
  308 +
  309 + let newzhinengarr1 = that.data.zhinengarr;
  310 + for (var obj of newzhinengarr1) {
  311 + if (obj.city == that.data.city) {
  312 + obj.sel = true
  313 + }
  314 + }
  315 +
  316 +
  317 + that.setData({
  318 + zhinengarr: newzhinengarr1
  319 + })
  320 +
  321 +
  322 + } else if (that.data.type == 5) {
  323 + that.setData({
  324 +
  325 + zhinengarr: res.odor
  326 + })
  327 +
  328 + let newzhinengarr = that.data.zhinengarr;
  329 + for (var obj of newzhinengarr) {
  330 + obj.sel = false
  331 + }
  332 +
  333 + that.setData({
  334 + zhinengarr: newzhinengarr
  335 + })
  336 +
  337 +
  338 + let newzhinengarr1 = that.data.zhinengarr;
  339 + for (var obj of newzhinengarr1) {
  340 + if (obj.id == that.data.odor_id) {
  341 + obj.sel = true
  342 + }
  343 + }
  344 +
  345 +
  346 + that.setData({
  347 + zhinengarr: newzhinengarr1
  348 + })
  349 +
  350 + } else if (that.data.type == 6) {
  351 + that.setData({
  352 +
  353 + zhinengarr: res.score_list
  354 + })
  355 + }
  356 +
  357 +
  358 +
  359 +
  360 +
  361 +
  362 +
  363 +
  364 +
  365 +
  366 + }).catch((err) => {
  367 +
  368 + })
41 }, 369 },
42 - select(e){ 370 + //选择种类
  371 + shosekind(e) {
  372 + let id = e.currentTarget.dataset.id;
  373 + console.log(this.data.type)
  374 +
  375 +
  376 +
  377 + let newzhinengarr = this.data.zhinengarr;
  378 + for (var obj of newzhinengarr) {
  379 + if (obj.id == id) {
  380 +
  381 +
  382 + if (this.data.type == 1) {
  383 + obj.sel = !obj.sel;
  384 + if (obj.sel == true) {
  385 + this.setData({
  386 + use_id: obj.id
  387 + })
  388 +
  389 + let newnavarr = this.data.navarr;
  390 + newnavarr[0].name = obj.use_name;
  391 + this.setData({
  392 + navarr: newnavarr
  393 + })
  394 + } else {
  395 + this.setData({
  396 + use_id: ''
  397 + })
  398 + }
  399 +
  400 + this.getmorenconetent()
  401 + } else if (this.data.type == 3) {
  402 + obj.sel = !obj.sel;
  403 + if (obj.sel == true) {
  404 + this.setData({
  405 + package_id: obj.id
  406 + })
  407 +
  408 + let newnavarr = this.data.navarr;
  409 + newnavarr[2].name = obj.package_name;
  410 + this.setData({
  411 + navarr: newnavarr
  412 + })
  413 + } else {
  414 + this.setData({
  415 + package_id: ''
  416 + })
  417 + }
  418 +
  419 + this.getmorenconetent()
  420 + } else if (this.data.type == 5) {
  421 + obj.sel = !obj.sel;
  422 + if (obj.sel == true) {
  423 + this.setData({
  424 + odor_id: obj.id
  425 + })
  426 +
  427 + let newnavarr = this.data.navarr;
  428 + newnavarr[4].name = obj.odor_name;
  429 + this.setData({
  430 + navarr: newnavarr
  431 + })
  432 + } else {
  433 + this.setData({
  434 + odor_id: ''
  435 + })
  436 + }
  437 +
  438 + this.getmorenconetent()
  439 + }
  440 +
  441 +
  442 + } else {
  443 + obj.sel = false
  444 + }
  445 +
  446 + if (this.data.type == 4) {
  447 + let cityname = e.currentTarget.dataset.name;
  448 +
  449 +
  450 +
  451 + if (obj.city == cityname) {
  452 + obj.sel = !obj.sel
  453 + if (obj.sel == true) {
  454 + this.setData({
  455 + city: obj.city,
  456 +
  457 + })
  458 +
  459 + let newnavarr = this.data.navarr;
  460 + newnavarr[3].name = obj.city;
  461 + this.setData({
  462 + navarr: newnavarr
  463 + })
  464 + } else {
  465 + this.setData({
  466 + city: ''
  467 + })
  468 +
  469 + }
  470 + } else {
  471 + obj.sel = false
  472 + }
  473 +
  474 + this.getmorenconetent()
  475 + }
  476 + }
  477 +
43 this.setData({ 478 this.setData({
44 - current:e.currentTarget.dataset.idx 479 + zhinengarr: newzhinengarr
  480 + })
  481 +
  482 +
  483 + },
  484 + //获取默认数据
  485 + getmorenconetent() {
  486 + let that = this;
  487 + let url = 'index/Filter/index',
  488 + params = {
  489 + use_id: that.data.use_id,
  490 + odor_id: that.data.odor_id,
  491 + pce:that.data.price,
  492 + package_id: that.data.package_id,
  493 + city: that.data.city,
  494 + score: that.data.score,
  495 + more: that.data.more,
  496 + page: that.data.page
  497 +
  498 + }
  499 + app.post(url, params).then((res) => {
  500 + console.log(res);
  501 + that.setData({
  502 + zhinenglist: res.list
  503 + })
  504 +
  505 +
  506 +
  507 + }).catch((err) => {
  508 +
  509 + })
  510 + },
  511 +
  512 + //收藏
  513 + collect(e) {
  514 + let that = this;
  515 + let id = e.currentTarget.dataset.id
  516 +
  517 + let url = 'index/Common/favorite',
  518 + params = {
  519 + sort: 1,
  520 + id: id
  521 +
  522 + }
  523 + app.post(url, params).then((res) => {
  524 +
  525 + wx.showToast({
  526 + title: res,
  527 + icon: 'none'
  528 + })
  529 + that.getmorenconetent()
  530 +
  531 +
  532 + }).catch((err) => {
  533 +
45 }) 534 })
46 - console.log(this.data.current)  
47 }, 535 },
48 536
49 /** 537 /**
50 * 生命周期函数--监听页面初次渲染完成 538 * 生命周期函数--监听页面初次渲染完成
51 */ 539 */
52 - onReady: function () { 540 + onReady: function() {
53 541
54 }, 542 },
55 543
56 /** 544 /**
57 * 生命周期函数--监听页面显示 545 * 生命周期函数--监听页面显示
58 */ 546 */
59 - onShow: function () { 547 + onShow: function() {
60 548
61 }, 549 },
62 550
63 /** 551 /**
64 * 生命周期函数--监听页面隐藏 552 * 生命周期函数--监听页面隐藏
65 */ 553 */
66 - onHide: function () { 554 + onHide: function() {
67 555
68 }, 556 },
69 557
70 /** 558 /**
71 * 生命周期函数--监听页面卸载 559 * 生命周期函数--监听页面卸载
72 */ 560 */
73 - onUnload: function () { 561 + onUnload: function() {
74 562
75 }, 563 },
76 564
77 /** 565 /**
78 * 页面相关事件处理函数--监听用户下拉动作 566 * 页面相关事件处理函数--监听用户下拉动作
79 */ 567 */
80 - onPullDownRefresh: function () { 568 + onPullDownRefresh: function() {
81 569
82 }, 570 },
83 571
84 /** 572 /**
85 * 页面上拉触底事件的处理函数 573 * 页面上拉触底事件的处理函数
86 */ 574 */
87 - onReachBottom: function () { 575 + onReachBottom: function() {
88 576
89 }, 577 },
90 578
91 /** 579 /**
92 * 用户点击右上角分享 580 * 用户点击右上角分享
93 */ 581 */
94 - onShareAppMessage: function () { 582 + onShareAppMessage: function() {
95 583
96 } 584 }
97 }) 585 })