作者 朱振飞

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

要显示太多修改。

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

... ... @@ -84,6 +84,50 @@ App({
return promise;
},
// 上传图片
upload(filetype, file) {
var promise = new Promise((resolve, reject) => {
let url = 'https://winesbook.cn/api/user/upload/one';
let head = {
'XX-Token': wx.getStorageSync('token'),
'XX-Device-Type': 'wxapp'
}
let typename = {
filetype: filetype
}
wx.uploadFile({
url: url, //仅为示例,非真实的接口地址
filePath: file,
name: 'file',
header: head,
formData: typename,
success: function (res) {
console.log('上传文件后', res)
let temdata = JSON.parse(res.data);
console.log(temdata)
let urlobj = {
url: temdata.data.url,
local_url: temdata.data.local_url
}
resolve(urlobj);
wx.hideNavigationBarLoading();
wx.hideLoading();
},
fail: function (res) {
reject('网络出错');
wx.hideNavigationBarLoading()
wx.hideLoading()
},
complete: () => {
wx.hideNavigationBarLoading()
wx.hideLoading()
},
})
});
return promise;
},
nowDate() {
let date = new Date();
let month = date.getMonth() + 1;
... ...
... ... @@ -2,20 +2,20 @@
"pages": [
"pages/login/login",
"pages/homapage/homepage",
"pages/homeblock/zhinengselect/zhinengselect",
"pages/homeblock/search/search",
"pages/find/find",
"pages/index/index",
"pages/logs/logs",
"pages/mine/mine",
"pages/myblock/personpage/personpage",
"pages/homeblock/niangjiuteacher/niangjiuteacher",
"pages/homeblock/brandlist/brandlist",
"pages/homeblock/brandpage/brandpage",
"pages/homeblock/companyintro/companyintro",
"pages/homeblock/zhinengselect/zhinengselect",
"pages/homeblock/shipaiimg/shipaiimg",
"pages/homeblock/guanimg/guanimg",
"pages/homeblock/shortvideo/shortvideo",
"pages/homeblock/niangjiuteacher/niangjiuteacher",
"pages/homeblock/jiuzidian/jiuzidian",
"pages/homeblock/evalute/evalute",
"pages/homeblock/evalutecontent/evalutecontent",
... ... @@ -28,8 +28,12 @@
"pages/forgetmima/forgetmima",
"pages/wanshangeren/wanshangeren",
"pages/peopleinfo/peopleinfo",
"pages/myblock/history/history",
"pages/jiudan/jiudan"
"pages/myblock/jifenjilu/jifenjilu",
"pages/myblock/pingjia/pingjia",
"pages/myblock/niangjiulist/niangjiulist",
"pages/myblock/shezhimima/shezhimima",
"pages/homeblock/video/video",
"pages/homeblock/shuxing/shuxing"
],
"window": {
"backgroundTextStyle": "light",
... ...
... ... @@ -64,7 +64,8 @@ image{
/* 关注 */
.atten{
width:100rpx;
/* width:100rpx; */
padding: 0 20rpx;
height:50rpx;
background:rgba(232,24,37,1);
border-radius:2rpx;
... ...
... ... @@ -191,6 +191,14 @@ Page({
})
},
//进入品牌页
jumpbrand(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/homeblock/brandlist/brandlist?id='+id,
})
},
//获取用户当前位置
getcity() {
... ... @@ -639,8 +647,11 @@ Page({
},
//筛选
shai(){
this.gethomeindex()
shaixuan(){
wx.navigateTo({
url: '/pages/homeblock/zhinengselect/zhinengselect',
})
// this.gethomeindex()
},
... ...
<!-- 种类的遮罩层 -->
<view class="register" wx:if="{{shai}}" bindtap="hideregister">
<view class="registerwrap">
<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>
<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>
<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>
<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>
</view>
</view>
<!-- 国家遮罩层 -->
<view class="cregister" wx:if="{{showcountry}}">
<view class="quehead">
<view class="backrow"></view>
<view class="selcoun">选择国别</view>
<view class="cqueding" bindtap="countrysure">确定</view>
</view>
<view class="countryitem" wx:for="{{countrylist}}" wx:key="" data-name="{{item.country_name}}" bindtap="selectcountry" data-id="{{item.id}}">
<view class="selcounitem">{{item.country_name}}</view>
<view class="gouimg" wx:if="{{item.sel==true}}">
<image src="{{url}}/aicon_18x.png"></image>
</view>
</view>
</view>
<!-- 城市遮罩层 -->
<view class="cregister" wx:if="{{showcity}}">
<view class="quehead">
<view class="backrow"></view>
<view class="selcoun">选择城市</view>
<view class="cqueding" bindtap="citysure">确定</view>
</view>
<view class="nodata" wx:if="{{citylist.length==0}}">暂无数据</view>
<block wx:else>
<view class="countryitem" wx:for="{{citylist}}" wx:key="" data-name="{{item.country_name}}" bindtap="selectcity" data-index="{{index}}">
<view class="selcounitem">{{item.city}}</view>
<!-- <view class="gouimg" wx:if="{{item.sel==true}}">
<image src="{{url}}/aicon_18x.png"></image>
</view> -->
</view>
</block>
</view>
<!-- 区域选择 -->
<view class="cregister" wx:if="{{showregin}}">
<view class="quehead">
<view class="backrow"></view>
<view class="selcoun">选择区</view>
<view class="cqueding" bindtap="sureregin">确定</view>
</view>
<view class="countryitem" wx:for="{{reginlist}}" wx:key="" data-name="{{item.name}}" bindtap="selectregin" data-index="{{index}}">
<view class="selcounitem">{{item.name}}</view>
<view class="gouimg" wx:if="{{item.sel==true}}">
<image src="{{url}}/aicon_18x.png"></image>
</view>
</view>
</view>
<view class="heatop">
<view class="head">
<view class="address">
<view class="addressimg">
<image src='{{url}}bicon_01x.png'></image>
</view>
<view class="addressname">{{currentCity}}</view>
</view>
<view class="headmiddle" bindtap="entersearch">
<view class="searchimg">
<image src="{{url}}aicon_04@2x.png"></image>
</view>
<view class="searchinput">
<input placeholder='已收录298653款酒品' placeholder-class='seachenter' value="{{record}}" />
</view>
<view class="saoma">
<image src="{{url}}bicon_04@2x.png"></image>
</view>
</view>
<view class="address" bindtap="shaixuan">
<view class="shaixuan">
<image src='{{url}}bicon_02@2x.png'></image>
</view>
<view class="addressname shai">筛选</view>
</view>
</view>
<!-- 筛选 -->
<view class="shaisel">
<view class="shaikind" bindtap="shaikind" data-type="{{item.type}}" wx:for="{{kindlist}}" wx:key="">
<view class="shaikindname">{{item.name}}</view>
<view class="shaikindimg">
<image src="{{url}}bicon_06x.png" wx:if="{{item.sel==true}}"></image>
<image src="{{url}}bicon_05x.png" wx:else></image>
</view>
</view>
</view>
<!-- <view class="hot">
<view class="hotimg">
<image src="{{url}}bicon_08@2x.png"></image>
</view>
<view class="hotzi">
<image src="{{url}}bicon_07@2x.png"></image>
</view>
</view> -->
</view>
<view class='city_box'>
<view class='city_left'>
<scroll-view scroll-y style='width:100%;height:100%;' scroll-with-animation scroll-into-view='{{cityListId}}'>
<view class="hot">
<view class="hotimg">
<image src="{{url}}bicon_08@2x.png"></image>
</view>
<view class="hotzi">
<image src="{{url}}bicon_07@2x.png"></image>
</view>
</view>
<view class='new_city'>
<view class='new_city_box'>
<view class='new_city_text' wx:for='{{newcity}}' wx:key='this' data-types='new' catchtap='cityTap' data-val='{{item}}'>
<view class="hotgood" bindtap="jumpbrand" data-id="{{item.id}}">
<view class="imgleft">
<image src="{{item.logo}}" mode='widthFix'></image>
</view>
<view class="contentright">
<view class="contenttop">{{item.name}}</view>
<view class="contenbottom">
<text class="textname">{{item.sort_name}}</text>
<text class="textname">{{item.country}}</text>
<text class="textname">{{item.city}}</text>
<text class="textname">{{item.odor_name}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class='city_list_box'>
<block wx:for='{{citylist}}' wx:key='this' wx:for-item='letterItem' wx:for-index='letterIndex'>
<view class='city_first_letter' id='{{letterItem.name}}'>{{letterItem.name}}</view>
<!-- {{item.cityName}} -->
<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}}'>
<view class="imgleft">
<image src="{{item.logo}}"></image>
</view>
<view class="contentright">
<view class="contenttop">{{item.name}}</view>
<view class="contenbottom">
<text class="textname">{{item.sort_name}}</text>
<text class="textname">{{item.country}}</text>
<text class="textname"> {{item.city}} </text>
<text class="textname">{{item.odor_name}}</text> </view>
</view>
</view>
</block>
</view>
</scroll-view>
</view>
<view class='city_right'>
<text class='letter_item' wx:for='{{letter}}' wx:key='this' catchtap='letterTap' data-item='{{item}}'>{{item}}</text>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -8,7 +8,12 @@ Page({
data: {
navbar: ['在售','预售','停产在售','停售'],
currentTab: 0,
url:""
url:"",
status:1,
brandid:'',
page:1,
info:'',
brandlist:[]
},
... ... @@ -16,15 +21,101 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
url: app.globalData.url
url: app.globalData.url,
brandid:options.id
})
this.getbrandlist()
},
navbarTap: function (e) {
this.setData({
currentTab: e.currentTarget.dataset.idx,
parent_id: e.currentTarget.dataset.id,
status:e.currentTarget.dataset.idx+1
})
this.getbrandlist()
},
//获取品牌主主页
getbrandlist(){
let that = this;
let url = 'index/Brand/index', params = {
status: that.data.status,
id: that.data.brandid,
page:that.data.page
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
info: res.info,
brandlist:res.list
})
}).catch((err) => {
})
},
//收藏品牌
collectbrand(e){
let that = this;
let id=e.currentTarget.dataset.id
let url = 'index/Common/favorite', params = {
sort: 2,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
that.getbrandlist()
}).catch((err) => {
})
},
//收藏酒品
collectwine(e){
let that = this;
let id = e.currentTarget.dataset.id;
let url = 'index/Common/favorite', params = {
sort:1,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
that.getbrandlist()
}).catch((err) => {
})
},
//品牌详情页
brandinfo(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/homeblock/brandpage/brandpage?id='+id,
})
},
/**
... ...
... ... @@ -3,14 +3,16 @@
</view>
</view>
<view class="brandhead">
<view class="brandhead" bindtap="brandinfo" data-id="{{info.id}}">
<view class="brandleft">
<view class="brandleftimg">
<image src="{{url}}aicon_19@2x.png"></image>
<image src="{{info.logo}}"></image>
</view>
<view class="lefttitle">白云边</view>
<view class="starimg">
<image src="{{url}}aicon_09x.png"></image>
<view class="lefttitle">{{info.name}}</view>
<view class="starimg" catchtap="collectbrand" data-id="{{info.id}}">
<image src="{{url}}aicon_10x.png" wx:if="{{info.is_favorite==1}}"></image>
<image src="{{url}}aicon_09x.png" wx:else></image>
</view>
</view>
<view class="brandright">
... ... @@ -21,32 +23,35 @@
</view>
</view>
<view class="baiyun">白云边</view>
<view class="baiyun">{{info.name}}</view>
<view>
<view >
<view class="searchitem">
<view class="nodata" wx:if="{{brandlist.length==0}}">暂无数据</view>
<block wx:else>
<view class="searchitem" wx:for="{{brandlist}}" wx:key=''>
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
<image src="{{item.logo}}"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="itemidelename">{{item.name}}</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">{{item.degree_name}}</text>
<text class="namebottomitem">{{item.odor_name}}</text>
<text class="namebottomitem">官方价{{item.price}}元</text>
<text class="namebottomitem">{{item.ml}}</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<view class="starimg" bindtap="collectwine" data-id="{{item.id}}">
<image src="{{url}}aicon_09x.png"></image>
<image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
<image src="{{url}}aicon_09x.png" wx:else></image>
</view>
</view>
</block>
</view>
\ No newline at end of file
... ...
// pages/homeblock/brandpage/brandpage.js
var WxParse = require('../../../wxParse/wxParse.js');
const app=getApp()
Page({
... ... @@ -6,7 +7,10 @@ Page({
* 页面的初始数据
*/
data: {
url:""
url:"",
id:'',
detailinfo:'',
attr:[]
},
/**
... ... @@ -14,10 +18,105 @@ Page({
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url
url: app.globalData.url,
id:options.id
})
this.getbrandtail()
},
//获取品牌详情页
getbrandtail(){
let that = this;
let url = 'index/Brand/detail', params = {
id:that.data.id
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
detailinfo:res.info,
attr:res.info.attr
})
let newattr = res.info.attr;
for (let i = 0; i < newattr.length; i++) {
newattr[i].show=true
WxParse.wxParse('content' + i, 'html', newattr[i]['content'], that, 5);
if (i === newattr.length - 1) {
WxParse.wxParseTemArray("artileList", 'content', newattr.length, that)
}
}
that.setData({
attr: newattr
})
}).catch((err) => {
})
},
//收藏
collect(e){
let id=e.currentTarget.dataset.id;
let that = this;
let url = 'index/Common/favorite', params = {
sort:2,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
that.getbrandtail()
}).catch((err) => {
})
},
//关注和取消关注
attention(e){
let id=e.currentTarget.dataset.id;
let that = this;
let url = 'index/Common/concern', params = {
sort:1,
id:id
}
app.post(url, params).then((res) => {
wx.showToast({
title: res,
icon:'none'
})
this.getbrandtail()
}).catch((err) => {
})
},
showinfo(e){
let idx=e.currentTarget.dataset.idx;
console.log(idx)
let newattr = this.data.attr;
for (var i = 0; i < newattr.length;i++){
if(i==idx){
newattr[i].show = !newattr[i].show
}
}
this.setData({
attr:newattr
})
console.log(this.data.attr)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
<import src="../../../wxParse/wxParse.wxml" />
<view class="brandhead">
<image src="{{url}}aicon_21@2x.png"></image>
<view class="branditem">
... ... @@ -5,50 +6,52 @@
<view class="branditemleft">
<view class="brandlimg">
<image src="{{url}}aicon_19@2x.png"></image>
<image src="{{detailinfo.logo}}"></image>
</view>
<view class="brandname">白云边</view>
<view class="brandname">{{detailinfo.name}}</view>
</view>
<view class="branditenright" wx:if="{{detailinfo.is_favorite==1}}" bindtap="collect" data-id="{{detailinfo.id}}">取消收藏</view>
<view class="branditenright" bindtap="collect" data-id="{{detailinfo.id}}" wx:else>收藏</view>
<view class="branditenright">收藏</view>
</view>
</view>
<view class="brandbottom">
<view class="brandboleft">
<text class="brandtitle">湖北白云边股份股份有限公司</text>
<text class="brandtitle">{{detailinfo.company_name}}</text>
<view class="duigou">
<image src="{{url}}aicon_20x.png"></image>
</view>
</view>
<view class="atten">关注</view>
<view class="atten" wx:if="{{detailinfo.is_concern==1}}" bindtap="attention" data-id="{{detailinfo.company_id}}">取消关注</view>
<view class="atten" wx:else bindtap="attention" data-id="{{detailinfo.company_id}}">关注</view>
</view>
<view class="brandbox">
<view class="brandboxitem">
<view class="brandboxitem" wx:for="{{attr}}" wx:key='' wx:for-index="idxs">
<view class="boxtop">
<view class="boxtopleft">
品牌简介
{{item.name}}
</view>
<view class="boxright">
<image src="{{url}}aicon_24x.png"></image>
<view class="boxright" bindtap="showinfo" data-idx="{{idxs}}">
<image src="{{url}}aicon_53x.png" wx:if="{{item.show}}"></image>
<image src="{{url}}aicon_52x.png" wx:else></image>
</view>
</view>
<view class="brandtext">
湖北白云边集团(以下简称“集团”或“白云边集团”)是一家以酒业为龙头产业的多元化投资控股企业集团,总部位于湖北省武汉市。白云边集团下设7大战略业务单位,包括白酒、食品餐饮、钢铁制造、置业投资、酒店旅游、物流商贸、文化传播等。白云边集团的多元化业务具有良好的产业基础和市场竞争优势,其中白酒已建立行业领先地位。截止2017年,白云边集团总资产达80余亿元。
</view>
<view class="brandimg">
<image src="{{url}}aicon_23@2x.png"></image>
<view class="brandtext" wx:if="{{item.show}}">
<block wx:for="{{artileList}}" wx:for-item="item" wx:for-index="idx" wx:key=''>
<block wx:if="{{idxs==idx}}">
<template is="wxParse" data="{{wxParseData:item}}" />
</block>
</block>
</view>
</view>
<view class="brandboxitem">
<!-- <view class="brandboxitem">
<view class="boxtop">
<view class="boxtopleft">
品牌文化
... ... @@ -63,6 +66,6 @@
<image src="{{url}}aicon_23@2x.png"></image>
</view>
</view>
</view> -->
</view>
\ No newline at end of file
... ...
... ... @@ -35,7 +35,7 @@ image{
align-items: center
}
.branditenright{
width:100rpx;
padding: 0 20rpx;
height:50rpx;
background:rgba(255,255,255,1);
border-radius:2px;
... ...
// pages/homeblock/companyintro/companyintro.js
var WxParse = require('../../../wxParse/wxParse.js');
const app=getApp()
Page({
... ... @@ -15,6 +16,9 @@ Page({
interval: 2000,
duration: 1000,
currentSwiper: 0,
id:'',
attr:[],
companyinfo:''
},
... ... @@ -23,14 +27,91 @@ Page({
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url
url: app.globalData.url,
id:options.id
})
this.getcompanydetail()
},
swiperChange: function (e) {
this.setData({
currentSwiper: e.detail.current
})
},
//获取企业详情
getcompanydetail(){
let that = this;
let url = 'index/Company/detail', params = {
id:that.data.id
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
companyinfo: res,
imgUrls:res.banner,
attr: res.attr
})
let newattr = res.attr;
for (let i = 0; i < newattr.length; i++) {
newattr[i].show = true
WxParse.wxParse('content' + i, 'html', newattr[i]['content'], that, 5);
if (i === newattr.length - 1) {
WxParse.wxParseTemArray("artileList", 'content', newattr.length, that)
}
}
that.setData({
attr: newattr
})
}).catch((err) => {
})
},
showinfo(e){
let idx = e.currentTarget.dataset.idx;
console.log(idx)
let newattr = this.data.attr;
for (var i = 0; i < newattr.length; i++) {
if (i == idx) {
newattr[i].show = !newattr[i].show
}
}
this.setData({
attr: newattr
})
},
//关注和取消关注
attention(e){
let that = this;
let id=e.currentTarget.dataset.id;
let url = 'index/Common/concern', params = {
sort:1,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
that.getcompanydetail()
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
<import src="../../../wxParse/wxParse.wxml" />
<view class="brandbottom">
<view class="brandboleft">
<text class="brandtitle">湖北白云边股份股份有限公司</text>
<text class="brandtitle">{{companyinfo.name}}</text>
<view class="duigou">
<image src="{{url}}aicon_20x.png"></image>
</view>
</view>
<view class="atten">关注</view>
<view class="atten" wx:if="{{companyinfo.is_concern==0}}" bindtap="attention" data-id="{{companyinfo.id}}">关注</view>
<view class="atten" wx:else bindtap="attention" data-id="{{companyinfo.id}}">取消关注</view>
</view>
<view class="swiper_image">
<view class="swiper_image">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" class="swiper_item_img" bindchange="swiperChange">
<block wx:for="{{imgUrls}}" wx:key="doct">
<swiper-item style="border-radius:10px;">
<image src="{{item}}" data-index='{{index}}' class="slide-image" bindtap='viewImg' width="355" height="150" />
<image src="{{item.url}}" data-index='{{index}}' class="slide-image" bindtap='viewImg' width="355" height="150" />
</swiper-item>
</block>
</swiper>
... ... @@ -26,30 +27,33 @@
</block>
</view>
</view>
</view>
<view class="brandbox">
<view class="brandboxitem">
<view class="brandboxitem" wx:for="{{attr}}" wx:key='' wx:for-index="idxs">
<view class="boxtop">
<view class="boxtopleft">
品牌简介
{{item.name}}
</view>
<view class="boxright">
<image src="{{url}}aicon_24x.png"></image>
<view class="boxright" bindtap="showinfo" data-idx="{{idxs}}">
<image src="{{url}}aicon_53x.png" wx:if="{{item.show}}"></image>
<image src="{{url}}aicon_52x.png" wx:else></image>
</view>
</view>
<view class="brandtext">
湖北白云边集团(以下简称“集团”或“白云边集团”)是一家以酒业为龙头产业的多元化投资控股企业集团,总部位于湖北省武汉市。白云边集团下设7大战略业务单位,包括白酒、食品餐饮、钢铁制造、置业投资、酒店旅游、物流商贸、文化传播等。白云边集团的多元化业务具有良好的产业基础和市场竞争优势,其中白酒已建立行业领先地位。截止2017年,白云边集团总资产达80余亿元。
<view class="brandtext" wx:if="{{item.show}}">
<block wx:for="{{artileList}}" wx:for-item="item" wx:for-index="idx" wx:key=''>
<block wx:if="{{idxs==idx}}">
<template is="wxParse" data="{{wxParseData:item}}" />
</block>
</block>
</view>
<view class="brandimg">
<image src="{{url}}aicon_23@2x.png"></image>
</view>
</view>
<view class="brandboxitem">
<!-- <view class="brandboxitem">
<view class="boxtop">
<view class="boxtopleft">
品牌文化
... ... @@ -64,6 +68,6 @@
<image src="{{url}}aicon_23@2x.png"></image>
</view>
</view>
</view> -->
</view>
\ No newline at end of file
... ...
// pages/homeblock/evalute/evalute.js
const app=getApp()
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
url:'',
star1:0,
sepic:false
url: '',
star1: 0,
sepic: true,
id: '',
biaoqian: false,
tablist: [],
labelname: '',
images: [],
videoimg: '',
chuanimages:[],
chuanvideoimg:'',
currentCity: '',
content: '',
current: '',
labelid: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
this.setData({
url: app.globalData.url,
id: options.wineid
})
this.gettablist();
this.getcity()
},
//获取用户当前位置
getcity() {
let that = this;
wx.getLocation({
type: 'gcj02',
success: function(res) {
// 经纬度
var latitude = res.latitude
var longitude = res.longitude
var aK = that.data.aK
wx.request({
url: 'https://api.map.baidu.com/geocoder/v2/?ak=y8jPDTMIuAnaVscUztce1RKfNx8v5sok&location=' + latitude + ',' + longitude + '&output=json',
data: {},
header: {
'content-type': 'application/json'
},
success: function(res) {
console.log('1234567890', res)
var province = res.data.result.addressComponent.province;
let district = res.data.result.addressComponent.district
that.setData({
currentCity: province
})
wx.setStorageSync('city', province)
wx.request({
// url: 'xxx' + city,
// data: {},
// header: {
// 'content-type': 'application/json'
// },
// success: function (res) {
// that.setData({
// county: res.data,
// })
// },
})
}
})
},
fail: function() {
wx.showToast({
title: '授权失败,请打开GPS重新进入页面授权',
icon: 'none',
duration: 2000
})
}
})
},
//获取标签列表
gettablist() {
let that = this;
let url = 'index/Wine/tag_list',
params = {
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
tablist: res.list
})
let newtablist = that.data.tablist;
for (var obj of newtablist) {
obj.sel = false
}
that.setData({
tablist: newtablist
})
}).catch((err) => {
})
},
//输入标签
enterlabel(e) {
this.setData({
labelname: e.detail.value
})
},
//选择标签
selectlabel(e) {
let idx = e.currentTarget.dataset.idx;
let id = e.currentTarget.dataset.id;
let newtablist=this.data.tablist;
for (var obj of newtablist){
if (id==obj.id){
obj.sel = !obj.sel;
if (obj.sel == true) {
this.data.labelid.push(obj.id)
} else if (obj.sel==false) {
let newlabelid = this.data.labelid;
for (var i = 0; i < newlabelid.length;i++){
if(newlabelid[i]==obj.id){
newlabelid.splice(i, 1);
}
}
this.setData({
labelid: newlabelid
})
}
if (this.data.labelid.length>3){
wx.showToast({
title: '最多选择三个标签',
icon:'none'
})
let newlabelid = this.data.labelid;
for (var i = 0; i < newlabelid.length; i++) {
if (newlabelid[i] == obj.id) {
newlabelid.splice(i, 1);
}
}
obj.sel=false
}
}
}
console.log(this.data.labelid)
this.setData({
tablist: newtablist
})
},
sureadd() {
let that = this;
if (that.data.labelname.length > 10) {
wx.showToast({
title: '请输入10以下的字符',
icon: 'none'
})
} else {
let url = 'index/Wine/create_tag',
params = {
name: that.data.labelname
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: '添加成功',
icon: 'none'
})
that.setData({
biaoqian: false
})
that.gettablist()
}).catch((err) => {
console.log(err)
wx.showToast({
title: err.data.msg,
icon:"none"
})
})
}
},
hideregister() {
this.setData({
url: app.globalData.url
biaoqian: false
})
},
star(e){
addnewlabel() {
this.setData({
biaoqian: true
})
},
cancel() {
this.setData({
biaoqian: false
})
},
star(e) {
this.setData({
star1:e.currentTarget.dataset.id
star1: e.currentTarget.dataset.id
})
},
se(){
se() {
this.setData({
sepic: !this.data.sepic
})
},
//添加图片
chooseImage() {
let that = this;
wx.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
success: function(res) {
console.log(res)
app.upload('image', res.tempFilePaths[0]).then((res) => {
console.log('上传文件' + res);
let data = JSON.parse(JSON.stringify(res))
console.log(data)
let arr = that.data.images;
let chuanarr=that.data.chuanimages;
chuanarr.push(data.local_url)
arr.push(data.url)
that.setData({
images: arr,
chuanimages:chuanarr
})
console.log(that.data.chuanimages)
}).catch((err) => {
console.log(err)
})
},
fail: function(res) {}
})
},
//删除照片
delimg(e) {
let idx = e.currentTarget.dataset.index;
let newimages = this.data.images;
for (var i = 0; i < newimages.length; i++) {
if (i == idx) {
newimages.splice(i, 1)
}
}
let newchuanimages=this.data.chuanimages;
for(var i=0;i<newchuanimages.length;i++){
if (i == idx) {
newchuanimages.splice(i, 1)
}
}
this.setData({
images: newimages,
chuanimages:newchuanimages
})
},
//上传视频
choosevideo() {
let that = this;
wx.chooseVideo({
sourceType: ['album', 'camera'],
maxDuration: 60,
camera: 'back',
success(res) {
console.log(res.tempFilePath);
that.setData({
videoimg: res.tempFilePath,
})
// app.upload('video', res.tempFilePath).then((res) => {
// let videos = that.data.videos;
// videos.push(res.url);
// that.setData({
// videos: videos
// })
// }).catch((err) => {
// console.log(err)
// })
let file = res.tempFilePath
that.upload(file)
}
})
},
upload(file) {
let that=this;
let url = 'https://winesbook.cn/api/user/upload/one';
let head = {
'XX-Token': wx.getStorageSync('token'),
'XX-Device-Type': 'wxapp'
}
// let typename = {
// filetype: filetype
// }
wx.uploadFile({
url: url, //仅为示例,非真实的接口地址
filePath: file,
name: 'file',
header: head,
formData: {
filetype: 'video'
},
success: function(res) {
console.log('上传文件后', JSON.parse(res.data))
let data = JSON.parse(res.data)
that.setData({
chuanvideoimg: data.data.local_url
})
// let temdata = JSON.parse(res.data);
// let urlobj = {
// url: temdata.data.preview_url
// }
// resolve(urlobj);
// wx.hideNavigationBarLoading();
// wx.hideLoading();
},
fail: function(res) {
reject('网络出错');
wx.hideNavigationBarLoading()
wx.hideLoading()
},
complete: () => {
wx.hideNavigationBarLoading()
wx.hideLoading()
},
})
},
// 删除音频
delvideo() {
this.setData({
videoimg: '',
chuanvideoimg:''
})
},
//输入评论
entercontent(e) {
this.setData({
content: e.detail.value
})
},
//发布
publish() {
let that = this;
let newfiles = [];
let newimages = that.data.chuanimages;
if (that.data.chuanvideoimg != '') {
newfiles.push(that.data.chuanvideoimg)
}
if (newimages.length != 0) {
for (var i = 0; i < newimages.length; i++) {
newfiles.push(newimages[i])
}
}
newfiles = newfiles.join(",");
console.log(newfiles)
let newlabelid=that.data.labelid;
newlabelid= newlabelid.join(",")
console.log(newlabelid)
let url = 'index/Wine/create_comment',
params = {
wine_id: that.data.id,
score: that.data.star1,
content: that.data.content,
files: newfiles,
position: that.data.currentCity,
tags: newlabelid
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: '发布成功',
icon:'none'
})
setTimeout(function(){
wx.navigateBack({
checked:true
})
},1500)
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
<!-- 新增标签 -->
<view class="register" wx:if="{{biaoqian}}" bindtap="hideregister">
<view class="registerwrap" catchtap='tab'>
<view class="enterbiao">输入标签名</view>
<view class="enterword">
<input placeholder='标签名10个汉字(20个字符)以内' placeholder-class='enter' bindinput="enterlabel" />
</view>
<view class="tabottom">
<view class="cancel" catchtap='cancel'>取消</view>
<view class="sure" bindtap="sureadd">确定</view>
</view>
</view>
</view>
<view star>
<view class="starname">滑动星星评分</view>
<view class="starlist">
... ... @@ -30,22 +45,15 @@
选择标签
</view>
<view class="biaoqianright" bindtap="se">
<image src="{{sepic==false?'http://winesbook.cn/static/images_mini/aicon_53x.png':'http://winesbook.cn/static/images_mini/aicon_52x.png'}}"></image>
<image src="{{sepic==true?'http://winesbook.cn/static/images_mini/aicon_53x.png':'http://winesbook.cn/static/images_mini/aicon_52x.png'}}"></image>
</view>
</view>
<view class="showpic">
<view class="showpicitem">婚宴</view>
<view class="showpicitem">婚宴</view>
<view class="showpicitem">婚宴</view>
<view class="showpicitem">婚宴</view>
<view class="showpicitem">婚宴</view>
<view class="showpicitem">婚宴</view>
<view class="showpicitem">婚宴</view>
<view class="showpicitem">婚宴</view>
<view class="showpicitem">婚宴</view>
<view class="addnew">
<view class="showpic" wx:if="{{sepic}}">
<view class="showpicitem {{item.sel==true?'labelactive':''}}" wx:for="{{tablist}}" wx:key='' catchtap='selectlabel' data-id="{{item.id}}" data-idx="{{index}}">{{item.name}}</view>
<view class="addnew" bindtap="addnewlabel">
<view class="jia">
<image src="/img/aicon66.png"></image>
</view>
... ... @@ -58,44 +66,47 @@
<view class="imgbox">
<block wx:for="{{images}}" wx:key="">
<view class="imgboxite">
<image src="{{url}}/aicon_49@2x.png"></image>
<image src="{{item}}"></image>
<view class="cha">
<view class="cha" bindtap="delimg" data-index="{{index}}">
<image src="{{url}}/aicon_54x.png"></image>
</view>
</view>
<view class="imgboxite">
<image src="{{url}}/aicon_49@2x.png"></image>
</block>
<view class="cha">
<image src="{{url}}/aicon_54x.png"></image>
</view>
</view>
<block wx:if="{{videoimg!=''}}" wx:key="">
<view class="imgboxite">
<image src="{{url}}/aicon_49@2x.png"></image>
<video src="{{videoimg}}"></video>
<view class="cha">
<view class="cha" bindtap="delvideo" data-index="{{index}}">
<image src="{{url}}/aicon_54x.png"></image>
</view>
</view>
<view class="imgboxite">
<image src="{{url}}/aicon_49@2x.png"></image>
</block>
<view class="cha">
<image src="{{url}}/aicon_54x.png"></image>
</view>
<block wx:if="{{videoimg!=''}}">
<view class="addimg" bindtap="chooseImage" wx:if="{{images.length<5}}">
<image src="{{url}}/aicon_55x.png"></image>
</view>
<view class="addimg">
</block>
<block wx:else>
<view class="addimg" bindtap="chooseImage" wx:if="{{images.length<6}}">
<image src="{{url}}/aicon_55x.png"></image>
</view>
</block>
<block wx:if="{{videoimg==''}}">
<view class="addimg" bindtap="choosevideo" wx:if="{{images.length<6}}">
<image src="/img/cicon17@2x.png"></image>
</view>
</block>
</view>
<view class="entersay saybox">
<textarea placeholder='这酒怎么样我来说一说' placeholder-class='entersay'/>
<textarea placeholder='这酒怎么样我来说一说' placeholder-class='entersay' bindinput="entercontent"/>
</view>
<view class="saybottom">
... ... @@ -104,8 +115,8 @@
<image src="{{url}}/aicon_56x.png"></image>
</view>
<view class="leftword">所在位置</view>
<view class="leftword">{{currentCity}}</view>
</view>
<view class="sayright">发布</view>
<view class="sayright" bindtap="publish">发布</view>
</view>
\ No newline at end of file
... ...
... ... @@ -47,6 +47,11 @@
color:#1A1A1A;
font-size: 24rpx;
text-align: center;
background: #F2F2F2;
margin-left:10rpx;
margin-top:10rpx;
border-radius:10rpx;
border:1rpx solid transparent
}
.addnew{
... ... @@ -57,6 +62,8 @@
border:1rpx solid rgba(232,24,37,1);
border-radius:5rpx;
justify-content: center;
margin-left:10rpx;
margin-top:10rpx;
}
.jia{
width:15rpx;
... ... @@ -74,6 +81,10 @@
position: relative;
margin-top:20rpx;
}
.imgboxite video{
width:210rpx;
height:210rpx;
}
.imgboxite{
margin-left:28rpx;
}
... ... @@ -133,3 +144,73 @@ display:flex;
color:#E81825;
font-size: 32rpx
}
.register{
top:0;
}
.registerwrap{
width:610rpx;
height:350rpx;
background: #ffffff;
position: absolute;
z-index: 99;
top:50%;
left:50%;
transform: translate(-50%,-50%);
padding: 45rpx 45rpx 0;
box-sizing: border-box
}
.enterbiao{
color:#666666;
font-size: 34rpx;
text-align: center;
margin-top:22rpx;
}
.enterword{
width:520rpx;
height:80rpx;
color:#999999;
font-size: 26rpx;
text-align: center;
margin-top:25rpx;
}
.enterword input{
width:520rpx;
height:80rpx;
text-align: center
}
.enter{
color:#999999;
font-size: 26rpx
}
.tabottom{
height:90rpx;
border-top:1rpx solid #f5f5f5;
display:flex;
align-items: center;
justify-content: space-between;
margin-top:45rpx;
}
.cancel{
width:50%;
height:90rpx;
line-height: 90rpx;
text-align: center;
border-right:1rpx solid #f5f5f5;
color:#999999;
font-size: 32rpx;
}
.sure{
width:50%;
text-align: center;
height:90rpx;
line-height: 90rpx;
color:#E81825;
font-size: 32rpx;
}
.labelactive{
border:1rpx solid #E81825
}
\ No newline at end of file
... ...
... ... @@ -7,6 +7,11 @@ Page({
*/
data: {
url: '',
id:'',
page:1,
hot_tag:[],
list:[],
statistics:''
},
/**
... ... @@ -14,10 +19,115 @@ Page({
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url
url: app.globalData.url,
id:options.wineid
})
},
formatDate(datetime) {
// 获取年月日时分秒值 slice(-2)过滤掉大于10日期前面的0
var date = new Date(datetime * 1000)
var Y = date.getFullYear();
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
var D = (date.getDate() + 1 < 10 ? '0' + (date.getDate()) : date.getDate())
var h = date.getHours() + ':';
var m = date.getMinutes() + ':';
var s = date.getSeconds();
// 拼接
var result = Y + "-" + M + "-" + D
console.log(result)
this.setData({
date: result
})
// 返回
return result;
},
//获取评论列表
getcommentlist(){
let that = this;
let url = 'index/Wine/comment_list', params = {
wine_id:that.data.id,
page:that.data.page
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
hot_tag: res.hot_tag,
list: res.list,
statistics: res.statistics,
headscore: res.statistics.score*10
})
let newlist=res.list;
for (var obj of newlist){
obj.score=obj.score*10;
var date = new Date(obj.create_time * 1000)
var Y = date.getFullYear();
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
var D = (date.getDate() + 1 < 10 ? '0' + (date.getDate()) : date.getDate())
var h = date.getHours() + ':';
var m = date.getMinutes() + ':';
var s = date.getSeconds();
// 拼接
var result = Y + "年" + M + "月" + D+'日'
obj.create_time=result
}
that.setData({
list:newlist
})
console.log(that.data.list)
}).catch((err) => {
})
},
//进入视频页面
entervido(e){
let url=e.currentTarget.dataset.url
wx.navigateTo({
url: '/pages/homeblock/video/video?url='+url,
})
},
//点赞和取消点赞
dianzan(e){
let that = this;
let id=e.currentTarget.dataset.id
let url = 'index/Common/good', params = {
sort:5,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:"none"
})
that.getcommentlist()
}).catch((err) => {
})
},
//评价列表
publishcomment(){
wx.navigateTo({
url: '/pages/homeblock/evalute/evalute?wineid='+this.data.id,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -29,7 +139,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getcommentlist()
},
/**
... ...
<view class="boxhead">
<view class="evalutetop">
<view class="evalutetop">
<view class="evaluteleft">
<view class="code">7.4</view>
<view class="code">{{statistics.score}}</view>
<view class="evalutetop">
<view class="evaluteitem">
<image src="/img/aicon_28@2x.png"></image>
<view class="evaluteitemx">
<image src="{{url}}/aicon_37@2x.png" wx:if="{{headscore<5}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{headscore>=55&&headscore<10}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{headscore>=10}}"></image>
</view>
<view class="evaluteitem">
<image src="/img/aicon_28@2x.png"></image>
<view class="evaluteitemx">
<image src="{{url}}/aicon_37@2x.png" wx:if="{{headscore<15}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{headscore>=15&&headscore<20}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{headscore>=20}}"></image>
</view>
<view class="evaluteitem">
<image src="/img/aicon_28@2x.png"></image>
<view class="evaluteitemx">
<image src="{{url}}/aicon_37@2x.png" wx:if="{{headscore<25}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{headscore>=25&&headscore<30}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{headscore>=30}}"></image>
</view>
<view class="evaluteitem">
<image src="/img/aicon_28@2x.png"></image>
<view class="evaluteitemx">
<image src="{{url}}/aicon_37@2x.png" wx:if="{{headscore<35}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{headscore>=35&&headscore<40}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{headscore>=40}}"></image>
</view>
<view class="evaluteitem">
<image src="/img/aicon_28@2x.png"></image>
<view class="evaluteitemx">
<image src="{{url}}/aicon_37@2x.png" wx:if="{{headscore<45}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{headscore>=45&&headscore<50}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{headscore>=50}}"></image>
</view>
</view>
</view>
... ... @@ -42,9 +52,9 @@
</view>
<view class="tiao">
<view class="tiaoitem"></view>
<view class="tiaoitem" style="width:{{statistics.five_percent}}%"></view>
</view>
<view class="pingfen">36.1%</view>
<view class="pingfen">{{statistics.five_percent}}%</view>
</view>
... ... @@ -66,9 +76,9 @@
</view>
<view class="tiao">
<view class="tiaoitem"></view>
<view class="tiaoitem" style="width:{{statistics.four_percent}}%"></view>
</view>
<view class="pingfen">36.1%</view>
<view class="pingfen">{{statistics.four_percent}}%</view>
</view>
... ... @@ -87,9 +97,9 @@
</view>
<view class="tiao">
<view class="tiaoitem"></view>
<view class="tiaoitem" style="width:{{statistics.three_percent}}%"></view>
</view>
<view class="pingfen">36.1%</view>
<view class="pingfen">{{statistics.three_percent}}%</view>
</view>
... ... @@ -105,9 +115,9 @@
</view>
<view class="tiao">
<view class="tiaoitem"></view>
<view class="tiaoitem" style="width:{{statistics.two_percent}}%"></view>
</view>
<view class="pingfen">36.1%</view>
<view class="pingfen">{{statistics.two_percent}}%</view>
</view>
... ... @@ -120,140 +130,105 @@
</view>
<view class="tiao">
<view class="tiaoitem"></view>
<view class="tiaoitem" style="width:{{statistics.one_percent}}%"></view>
</view>
<view class="pingfen">36.1%</view>
<view class="pingfen">{{statistics.one_percent}}%</view>
</view>
</view>
</view>
</view>
<view class="hotticket">热门标签</view>
<view class="hotticket">热门标签</view>
<view class="botlabet">
<view class="labelitem">
<text>婚宴</text>
<text class="labelitemright">63</text>
</view>
<view class="labelitem">
<text>喜庆</text>
<text class="labelitemright">63</text>
</view>
<view class="labelitem">
<text>好喝</text>
<text class="labelitemright">63</text>
<view class="botlabet">
<view class="labelitem" wx:for="{{hot_tag}}" wx:key=''>
<text>{{item.name}}</text>
<text class="labelitemright">{{item.comment_count}}</text>
</view>
<view class="labelitem">
<text>实惠</text>
<text class="labelitemright">63</text>
</view>
</view>
</view>
<view class="boxmiddle">
<view class="boxmiddleitem">
<view class="boxmiddleitem" wx:for="{{list}}" wx:key=''>
<view class="evaluteitemleft">
<image src="{{url}}/aicon_45@2x.png"></image>
<image src="{{item.avatar}}"></image>
</view>
<view class="evaluteitemright">
<view class="evalname">小叶子</view>
<view class="evalname">{{item.user_nickname}}</view>
<view class="evalstarword">
<view class="evalstar">
<view class="evalstaritem">
<image src="/img/aicon_28@2x.png"></image>
<image src="{{url}}/aicon_37@2x.png" wx:if="{{item.score<5}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{item.score>=55&&item.score<10}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{item.score>=10}}"></image>
</view>
<view class="evalstaritem">
<image src="/img/aicon_28@2x.png"></image>
<image src="{{url}}/aicon_37@2x.png" wx:if="{{item.score<15}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{item.score>=15&&item.score<20}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{item.score>=20}}"></image>
</view>
<view class="evalstaritem">
<image src="/img/aicon_28@2x.png"></image>
<image src="{{url}}/aicon_37@2x.png" wx:if="{{item.score<25}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{item.score>=25&&item.score<30}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{item.score>=30}}"></image>
</view>
<view class="evalstaritem">
<image src="/img/aicon_28@2x.png"></image>
<image src="{{url}}/aicon_37@2x.png" wx:if="{{item.score<35}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{item.score>=35&&item.score<40}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{item.score>=40}}"></image>
</view>
<view class="evalstaritem">
<image src="/img/aicon_28@2x.png"></image>
</view>
<view class="evalstaritem">
<image src="/img/aicon_28@2x.png"></image>
</view>
<image src="{{url}}/aicon_37@2x.png" wx:if="{{item.score<45}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{item.score>=45&&item.score<50}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{item.score>=50}}"></image>
</view>
<view class="evardate">2019年11月5日</view>
</view>
<view class="evaltext">弟弟结婚买了8箱</view>
<view class="zan">
<view class="zanimg">
<image src="/img/aicon_46x.png"></image>
<view class="evardate">{{item.create_time}}</view>
</view>
<view class="zannum">6.2k</view>
<view class="evaltext">{{item.content}}</view>
<view class="medioblock">
<block wx:if="{{item.files.length!=0}}">
<view class="evalimgitem" wx:for='{{item.files}}' wx:key="">
<image src="{{item}}"></image>
</view>
</view>
</view>
<view class="boxmiddleitem">
<view class="evaluteitemleft">
<image src="{{url}}/aicon_45@2x.png"></image>
</view>
</block>
<view class="evaluteitemright">
<view class="evalname">小叶子</view>
<view class="evalstarword">
<view class="evalstar">
<view class="evalstaritem">
<image src="/img/aicon_28@2x.png"></image>
</view>
<view class="evalstaritem">
<image src="/img/aicon_28@2x.png"></image>
</view>
<view class="evalstaritem">
<image src="/img/aicon_28@2x.png"></image>
</view>
<view class="evalstaritem">
<image src="/img/aicon_28@2x.png"></image>
<view class="evalimgitem videoimg" wx:if="{{item.video!=''}}" data-url="{{item.video}}" bindtap="entervido">
<image src="{{item.video_image}}"></image>
<view class="videoanniu">
<image src="{{url}}/aicon_70x.png"></image>
</view>
<view class="evalstaritem">
<image src="/img/aicon_28@2x.png"></image>
</view>
<view class="evalstaritem">
<image src="/img/aicon_28@2x.png"></image>
</view>
</view>
<view class="evardate">2019年11月5日</view>
</view>
<view class="evaltext">弟弟结婚买了8箱</view>
<view class="evalimg">
<view class="evalimgitem">
<image src="{{url}}/aicon_49@2x.png"></image>
</view>
<view class="evalimgitem">
<image src="{{url}}/aicon_49@2x.png"></image>
</view>
<view class="evalimgitem">
<image src="{{url}}/aicon_49@2x.png"></image>
</view>
<view class="evalimgitem">
<image src="{{url}}/aicon_49@2x.png"></image>
<view class="zan">
<view class="zanimg" bindtap="dianzan" data-id="{{item.id}}">
<image src="/img/aicon_46x.png" wx:if="{{item.is_good==1}}"></image>
<image src="/img/aicon_47x.png" wx:if="{{item.is_good==0}}"></image>
</view>
<view class="zannum">{{item.good_count}}</view>
</view>
</view>
</view>
</view>
<view class="write">
<view class="write" bindtap="publishcomment">
<view class="writeimg">
<image src="{{url}}/aicon_48x.png"></image>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -11,12 +11,16 @@ page {
box-sizing: border-box;
}
.evaluteitem {
.evaluteitemx {
width: 26rpx;
height: 24rpx;
font-size: 0;
margin-left: 9rpx;
}
.evaluteitemx image{
width:100%!important;
height:100%!important;
}
image {
width: 100%;
... ... @@ -73,7 +77,7 @@ image {
}
.tiaoitem {
width: 59%;
/* width: 59%; */
height: 6rpx;
border-radius: 2rpx;
background: #ffba25;
... ... @@ -106,6 +110,7 @@ image {
.boxmiddle {
padding: 0 30rpx;
box-sizing: border-box;
padding-bottom: 100rpx;
}
.evaluteitem {
... ... @@ -119,6 +124,9 @@ image {
background: rgba(205, 205, 205, 1);
border-radius: 50%;
}
.evaluteitemleft image{
border-radius:50%;
}
.evalname {
color: #666;
... ... @@ -176,9 +184,13 @@ image {
height: 190rpx;
border-radius: 5rpx;
font-size: 0;
margin-left:10rpx;
margin-right:10rpx;
margin-top:30rpx;
}
.evalimgitem video{
width: 190rpx!important;
height: 190rpx !important;
}
.evalimg{
display:flex;
... ... @@ -188,7 +200,8 @@ image {
.zan{
display:flex;
align-items:center;
justify-content: flex-end
justify-content: flex-end;
margin-top:30rpx;
}
.zanimg{
... ... @@ -207,10 +220,33 @@ image {
font-size: 0
}
.write{
width:750rpx;
background: #fff;
height:126rpx;
display: flex;
justify-content: flex-end;
padding:17rpx 30rpx 0;
box-sizing: border-box
box-sizing: border-box;
position: fixed;
bottom:0;
}
.medioblock{
display:flex;
flex-wrap: wrap;
}
.videoimg{
position: relative
}
.videoanniu{
width:90rpx;
height:90rpx;
font-size: 0;
position: absolute;
left:50%;
top:50%;
transform: translate(-50%,-50%)
}
.videoanniu image{
width:100%;
height:100%;
}
\ No newline at end of file
... ...
// pages/homeblock/guanimg/guanimg.js
const app=getApp()
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
url:''
url: '',
id: "",
picture:[],
banner:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
this.setData({
url: app.globalData.url
url: app.globalData.url,
id: options.wineid
})
this.getguantu()
},
//获取官图
getguantu() {
let that = this;
let url = 'index/Wine/wine_images',
params = {
wine_id:that.data.id,
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
banner:res.banner,
picture: res.picture
})
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
... ... @@ -3,18 +3,10 @@
</view>
<view class="biaozhaunbox">
<view class="biaozhuanitem">
<image src="{{url}}aicon_89@2x.png"></image>
</view>
<view class="biaozhuanitem">
<image src="{{url}}aicon_89@2x.png"></image>
</view>
<view class="biaozhuanitem">
<image src="{{url}}aicon_89@2x.png"></image>
</view>
<view class="biaozhuanitem">
<image src="{{url}}aicon_89@2x.png"></image>
<view class="biaozhuanitem" wx:for="{{banner}}" wx:key="">
<image src="{{item.url}}"></image>
</view>
</view>
... ... @@ -24,16 +16,8 @@
</view>
<view class="biaozhaunbox">
<view class="biaozhuanitem">
<image src="{{url}}aicon_89@2x.png"></image>
</view>
<view class="biaozhuanitem">
<image src="{{url}}aicon_89@2x.png"></image>
</view>
<view class="biaozhuanitem">
<image src="{{url}}aicon_89@2x.png"></image>
</view>
<view class="biaozhuanitem">
<image src="{{url}}aicon_89@2x.png"></image>
<view class="biaozhuanitem" wx:for="{{picture}}" wx:key=''>
<image src="{{item.url}}"></image>
</view>
</view>
\ No newline at end of file
... ...
// pages/homeblock/jiuzidian/jiuzidian.js
var WxParse = require('../../../wxParse/wxParse.js');
const app=getApp()
Page({
... ... @@ -6,24 +7,26 @@ Page({
* 页面的初始数据
*/
data: {
navarr: [
{
name: '基本参数'
},
{
name: '生产企业'
},
{
name: '酿酒师'
},
{
name: '关键词'
}, ],
navarr: [],
current: 0,
url:'',
kind:0,
picindex:0
picindex:0,
id:'',
wineinfo:'',
selectid:-1,
canshu:[],
qiye:[],
jiushi:[],
jiushiarr: [],
zhuanye:[],
jiben:[],
jiushishow:true,
othercontent:[],
qiyearr:[],
score:''
},
/**
... ... @@ -31,7 +34,189 @@ Page({
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url
url: app.globalData.url,
id:options.id,
wineinfo:''
})
this.getwinedetail()
},
//获取酒品详情
getwinedetail(){
let that = this;
let url = 'index/Wine/detail', params = {
wine_id: that.data.id,
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
wineinfo:res,
navarr: res.wine_attr,
score: res.score*10
})
console.log(that.data.score)
let newnavarr = that.data.navarr;
for (var obj of newnavarr){
if(obj.id==-1){
that.setData({
canshu:obj.value
})
}else if(obj.id==-2){
that.setData({
qiye:obj.value[0].attr,
qiyearr:obj.value[0]
})
let newqiye = obj.value[0].attr;
for (let i = 0; i < newqiye.length; i++) {
newqiye[i].show = true
WxParse.wxParse('content' + i, 'html', newqiye[i]['content'], that, 5);
if (i === newqiye.length - 1) {
WxParse.wxParseTemArray("artileList", 'content', newqiye.length, that)
}
}
that.setData({
qiye: newqiye
})
} else if (obj.id == -3) {
that.setData({
jiushi: obj.value[0],
jiushiarr:obj.value[0].attr
})
let newjiushiarr = obj.value[0].attr
for (let i = 0; i < newjiushiarr.length; i++) {
newjiushiarr[i].show = true
WxParse.wxParse('content' + i, 'html', newjiushiarr[i]['content'], that, 5);
if (i === newjiushiarr.length - 1) {
WxParse.wxParseTemArray("artileList1", 'content', newjiushiarr.length, that)
}
}
that.setData({
jiushiarr:newjiushiarr
})
} else if (obj.id == -4) {
that.setData({
zhuanye: obj.value
})
let newzhuanye = obj.value
for (let i = 0; i < newzhuanye.length; i++) {
newzhuanye[i].show = true
WxParse.wxParse('content' + i, 'html', newzhuanye[i]['content'], that, 5);
if (i === newzhuanye.length - 1) {
WxParse.wxParseTemArray("artileList2", 'content', newzhuanye.length, that)
}
}
that.setData({
zhuanye: newzhuanye
})
} else if (obj.id == -5) {
that.setData({
jiben: obj.value
})
}else{
that.setData({
othercontent: obj.value
})
let newothercontent = obj.value
for (let i = 0; i < newothercontent.length; i++) {
newothercontent[i].show = true
WxParse.wxParse('content' + i, 'html', newothercontent[i]['content'], that, 5);
if (i === newothercontent.length - 1) {
WxParse.wxParseTemArray("artileList4", 'content', newothercontent.length, that)
}
}
that.setData({
othercontent: newothercontent
})
}
}
}).catch((err) => {
})
},
jiushinfoshow(){
this.setData({
jiushishow: !this.data.jiushishow
})
},
//关注酒师
attenjiushi(e){
let that = this;
let id=e.currentTarget.dataset.id
let url = 'index/Common/concern', params = {
sort: 2,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
that.getwinedetail()
}).catch((err) => {
})
},
//关注企业
attenqiye(e){
let that = this;
let id = e.currentTarget.dataset.id
let url = 'index/Common/concern', params = {
sort: 1,
id: id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon: 'none'
})
that.getwinedetail()
}).catch((err) => {
})
},
selectkind(e){
... ... @@ -40,17 +225,84 @@ Page({
})
},
select(e) {
console.log(e)
this.setData({
current: e.currentTarget.dataset.idx
current: e.currentTarget.dataset.idx,
selectid:e.currentTarget.dataset.id
})
console.log(this.data.current)
console.log(this.data.selectid)
},
selectpic(e){
let pic = e.currentTarget.dataset.pic
this.setData({
picindex:e.currentTarget.dataset.pic
})
console.log(this.data.picindex)
if (pic==1){
wx.navigateTo({
url: '/pages/homeblock/guanimg/guanimg?wineid='+this.data.id,
})
}else if(pic==2){
wx.navigateTo({
url: '/pages/homeblock/shipaiimg/shipaiimg?wineid='+this.data.id,
})
}else if(pic==3){
wx.navigateTo({
url: '/pages/homeblock/shortvideo/shortvideo?wineid='+this.data.id,
})
}
},
showinfo(e) {
let idx = e.currentTarget.dataset.idx;
console.log(idx)
let newqiye = this.data.qiye;
for (var i = 0; i < newqiye.length; i++) {
if (i == idx) {
newqiye[i].show = !newqiye[i].show
}
}
this.setData({
qiye: newqiye
})
},
showjiushi(e){
let idx = e.currentTarget.dataset.idx;
console.log(idx)
let newjiushiarr = this.data.jiushiarr;
for (var i = 0; i < newjiushiarr.length; i++) {
if (i == idx) {
newjiushiarr[i].show = !newjiushiarr[i].show
}
}
this.setData({
jiushiarr: newjiushiarr
})
},
showzhuanye(e){
let idx = e.currentTarget.dataset.idx;
console.log(idx)
let newzhuanye = this.data.zhuanye;
for (var i = 0; i < newzhuanye.length; i++) {
if (i == idx) {
newzhuanye[i].show = !newzhuanye[i].show
}
}
this.setData({
zhuanye: newzhuanye
})
},
//评价页面
evalute(){
wx.navigateTo({
url: '/pages/homeblock/evalutecontent/evalutecontent?wineid='+this.data.id,
})
},
/**
... ...
<import src="../../../wxParse/wxParse.wxml" />
<!-- 展示图 -->
<view class="showpic">
<image src="{{url}}/aicon_89@2x.png"></image>
<image src="{{wineinfo.logo}}"></image>
<view class="kindlist">
<view class="kinditem {{kind==0?'kindactive':''}}" data-kind='0' bindtap="selectkind">瓶</view>
<view class="kinditem {{kind==1?'kindactive':''}}" data-kind='1' bindtap="selectkind">箱</view>
<view class="kinditem {{kind==2?'kindactive':''}}" data-kind='2' bindtap="selectkind">盒</view>
<view class="kinditem {{kind==1?'kindactive':''}}" data-kind='1' bindtap="selectkind">盒</view>
<view class="kinditem {{kind==2?'kindactive':''}}" data-kind='2' bindtap="selectkind">箱</view>
</view>
<view class="pickind">
... ... @@ -15,51 +16,56 @@
<view class="picitem {{picindex==3?'slectpic':''}}" data-pic="3" bindtap="selectpic">短视频</view>
</view>
</view>
<view class="shaisel">
<view class="kind">
<view class="shaikind" wx:for="{{navarr}}" wx:key='' bindtap="select" data-idx="{{index}}">
<view class="shaikindname {{current==index?'selactive':''}}">{{item.name}}</view>
<view class="shaikindimg">
<image src="{{current==index?'http://winesbook.cn/static/images_mini/aicon_16@2x.png':'http://winesbook.cn/static/images_mini/aicon_14x.png'}}"></image>
</view>
</view>
<!-- <view class="shaikind">
<view class="shaikindname">价格</view>
<view class="shaikindimg">
<image src="{{url}}aicon_14x.png"></image>
</view>
<view class="gaunfang">
<view class="guanfangtitle">{{wineinfo.name}}</view>
<view class="duigou" style="margin-left:20rpx;">
<image src="{{url}}aicon_20x.png"></image>
</view>
<view class="shaikind">
<view class="shaikindname">包装</view>
<view class="shaikindimg">
<image src="{{url}}aicon_14x.png"></image>
<view class="guanfang">官方认证</view>
<view class="wujiao">
<view class="wujiaoimg 1">
<image src="{{url}}/aicon_37@2x.png" wx:if="{{score<5}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{score>=55&&score<10}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{score>=10}}"></image>
</view>
<view class="wujiaoimg 2">
<image src="{{url}}/aicon_37@2x.png" wx:if="{{score<15}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{score>=15&&score<20}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{score>=20}}"></image>
</view>
<view class="shaikind">
<view class="shaikindname">产区</view>
<view class="shaikindimg">
<image src="{{url}}aicon_14x.png"></image>
<view class="wujiaoimg 3">
<image src="{{url}}/aicon_37@2x.png" wx:if="{{score<25}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{score>=25&&score<30}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{score>=30}}"></image>
</view>
<view class="wujiaoimg 4">
<image src="{{url}}/aicon_37@2x.png" wx:if="{{score<35}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{score>=35&&score<40}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{score>=40}}"></image>
</view>
<view class="shaikind">
<view class="shaikindname">香型</view>
<view class="shaikindimg">
<image src="{{url}}aicon_14x.png"></image>
<view class="wujiaoimg 5">
<image src="{{url}}/aicon_37@2x.png" wx:if="{{score<45}}"></image>
<image src="{{url}}/aicon_38@2x.png" wx:if="{{score>=45&&score<50}}"></image>
<image src="{{url}}/aicon_39@2x.png" wx:if="{{score>=50}}"></image>
</view>
</view>
<view class="shaikind">
<view class="shaikindname">产区</view>
<view class="fen">{{wineinfo.score}}分</view>
</view>
<view class="shaisel">
<view class="kind">
<view class="shaikind" wx:for="{{navarr}}" wx:key='' bindtap="select" data-idx="{{index}}" data-id="{{item.id}}">
<view class="shaikindname {{current==index?'selactive':''}}">{{item.name}}</view>
<view class="shaikindimg">
<image src="{{url}}aicon_14x.png"></image>
<!-- <image src="{{current==index?'http://winesbook.cn/static/images_mini/aicon_16@2x.png':'http://winesbook.cn/static/images_mini/aicon_14x.png'}}"></image> -->
</view>
</view>
<view class="shaikind">
<view class="shaikindname">评分</view>
<view class="shaikindimg">
<image src="{{url}}aicon_14x.png"></image>
</view>
</view> -->
</view>
... ... @@ -72,86 +78,55 @@
</view>
<!-- 基本参数 -->
<view class="jibencanshu" wx:if="{{current==0}}">
<view class="canshuitem">
<view class="canleft">酒精度</view>
<view class='cantext'>52%Vol.</view>
</view>
<view class="canshuitem">
<view class="canleft">净含量</view>
<view class='cantext'>52%500ml</view>
</view>
<view class="canshuitem">
<view class="canleft">原料</view>
<view class='cantext'>糯、稻、玉米、小麦、高粱</view>
</view>
<view class="canshuitem">
<view class="canleft">储存条件</view>
<view class='cantext'>52%请置放于干燥、阴凉、通风处</view>
</view>
<view class="canshuitem">
<view class="canleft">生产标准号</view>
<view class='cantext'>87865788</view>
</view>
<view class="canshuitem">
<view class="canleft">生产许可证号</view>
<view class='cantext'>87865788</view>
<view class="jibencanshu" wx:if="{{selectid==-1}}">
<view class="canshuitem" wx:for='{{canshu}}' wx:key="">
<view class="canleft">{{item.name}}</view>
<view class='cantext'>{{item.content}}</view>
</view>
</view>
<!-- 生产企业 -->
<view class="jiuqiye" wx:if="{{current==1}}">
<view class="jiuqiye" wx:elif="{{selectid==-2}}">
<view class="brandbottom">
<view class="brandboleft">
<text class="brandtitle">湖北白云边股份股份有限公司</text>
<text class="brandtitle">{{qiyearr.name}}</text>
<view class="duigou">
<image src="{{url}}aicon_20x.png"></image>
</view>
</view>
<view class="atten">关注</view>
<view class="atten" wx:if="{{qiyearr.is_concern==0}}" bindtap="attenqiye" data-id="{{qiyearr.id}}">关注</view>
<view class="atten" wx:if="{{qiyearr.is_concern==1}}" bindtap="attenqiye" data-id="{{qiyearr.id}}">取消关注</view>
</view>
<view class="brandbox">
<view class="brandboxitem">
<view class="brandboxitem" wx:for="{{qiye}}" wx:key='' wx:for-index="idxs">
<view class="boxtop">
<view class="boxtopleft">
品牌简介
{{item.name}}
</view>
<view class="boxright">
<image src="{{url}}aicon_24x.png"></image>
<view class="boxright" bindtap="showinfo" data-idx="{{idxs}}">
<image src="{{url}}aicon_53x.png" wx:if="{{item.show}}"></image>
<image src="{{url}}aicon_52x.png" wx:else></image>
</view>
</view>
<view class="brandtext">
湖北白云边集团(以下简称“集团”或“白云边集团”)是一家以酒业为龙头产业的多元化投资控股企业集团,总部位于湖北省武汉市。白云边集团下设7大战略业务单位,包括白酒、食品餐饮、钢铁制造、置业投资、酒店旅游、物流商贸、文化传播等。白云边集团的多元化业务具有良好的产业基础和市场竞争优势,其中白酒已建立行业领先地位。截止2017年,白云边集团总资产达80余亿元。
<view class="brandtext" wx:if="{{item.show}}">
<block wx:for="{{artileList}}" wx:for-item="item" wx:for-index="idx" wx:key=''>
<block wx:if="{{idxs==idx}}">
<template is="wxParse" data="{{wxParseData:item}}" />
</block>
</block>
</view>
<view class="brandimg">
<image src="{{url}}aicon_23@2x.png"></image>
</view>
</view>
<view class="brandboxitem">
<view class="boxtop">
<view class="boxtopleft">
品牌文化
</view>
<view class="boxright">
<image src="{{url}}aicon_24x.png"></image>
</view>
</view>
<view class="brandimg">
<image src="{{url}}aicon_23@2x.png"></image>
</view>
</view>
</view>
... ... @@ -159,27 +134,30 @@
<!-- 酿酒师 -->
<view class="jiuhsi" wx:if="{{current==2}}">
<view class="jiuhsi" wx:elif="{{selectid==-3}}">
<view class="teacherhead">
<view class="teacherleft">
<view class="teacimg">
<image src="{{url}}aicon_77@2x.png"></image>
<image src="{{jiushi.avatar}}"></image>
</view>
<view class="teacname">徐强</view>
<view class="teacname">{{jiushi.name}}</view>
<view class="teacgouimg">
<image src="{{url}}aicon_20x.png"></image>
</view>
</view>
<view class="atten">
<view class="atten" wx:if="{{jiushi.is_concern==0}}" bindtap="attenjiushi" data-id="{{jiushi.id}}">
关注
</view>
<view class="atten" wx:if="{{jiushi.is_concern==1}}" bindtap="attenjiushi" data-id="{{jiushi.id}}">
取消关注
</view>
</view>
<view class="wineimg">
<image src="{{url}}aicon_91x.png"></image>
<image src="{{jiushi.thumb}}"></image>
</view>
<view class="niangjiubox">
... ... @@ -189,51 +167,48 @@
<view class="boxtopleft">
基本信息
</view>
<view class="boxright">
<image src="{{url}}aicon_24x.png"></image>
<view class="boxright" bindtap="jiushinfoshow">
<image src="{{url}}aicon_53x.png" wx:if="{{jiushishow}}"></image>
<image src="{{url}}aicon_52x.png" wx:else></image>
</view>
</view>
<view class="brandtext">
<view class="brandtext" wx:if="{{jiushishow}}">
<view class="baisinfo">
<view class="basinfoleft">性别</view>
<view class="baisinforight">男</view>
<view class="baisinforight" wx:if="{{jiushi.sex==1}}">男</view>
<view class="baisinforight" wx:if="{{jiushi.sex==2}}">女</view>
</view>
<view class="baisinfo">
<view class="basinfoleft">年龄</view>
<view class="baisinforight">34</view>
<view class="baisinforight">{{jiushi.age}}</view>
</view>
<view class="baisinfo">
<view class="basinfoleft">所属酒厂</view>
<view class="baisinforight">广东顺德酒厂</view>
<view class="baisinforight">{{jiushi.company_name}}</view>
</view>
</view>
</view>
<view class="brandboxitem">
<view class="brandboxitem" wx:for="{{jiushiarr}}" wx:key='' wx:for-index="idxs">
<view class="boxtop">
<view class="boxtopleft">
专业履历
{{item.name}}
</view>
<view class="boxright">
<image src="{{url}}aicon_24x.png"></image>
<view class="boxright" bindtap="showjiushi" data-idx="{{idxs}}">
<image src="{{url}}aicon_53x.png" wx:if="{{item.show}}"></image>
<image src="{{url}}aicon_52x.png" wx:else></image>
</view>
</view>
<view class="brandtext">
<view class="brandlsit">
2009年接触葡萄酒。
</view>
<view class="brandlsit">
2010年—2011年在郑大工学院和财经学院任教计算机3D设计教师。
</view>
<view class="brandlsit">
2012年考取ESW葡萄酒中级品酒师证。
</view>
<view class="brandlsit">
2012年至今在优传葡萄酒有限公司从事葡萄酒销售,酒会承办工作。同时从事企业礼仪茶培训。
</view>
<view class="brandtext" wx:if="{{item.show}}">
<block wx:for="{{artileList1}}" wx:for-item="item" wx:for-index="idx" wx:key=''>
<block wx:if="{{idxs==idx}}">
<template is="wxParse" data="{{wxParseData:item}}" />
</block>
</block>
... ... @@ -243,47 +218,83 @@
</view>
<view class="brandboxitem">
</view>
</view>
<!-- 专业品评 -->
<view class="jiuqiye" wx:elif="{{selectid==-4}}">
<view class="brandbox">
<view class="brandboxitem" wx:for="{{zhuanye}}" wx:key='' wx:for-index="idxs">
<view class="boxtop">
<view class="boxtopleft">
代表作品
{{item.title}}
</view>
<view class="boxright">
<image src="{{url}}aicon_24x.png"></image>
<view class="boxright" bindtap="showzhuanye" data-idx="{{idxs}}">
<image src="{{url}}aicon_53x.png" wx:if="{{item.show}}"></image>
<image src="{{url}}aicon_52x.png" wx:else></image>
</view>
</view>
<view class="brandtext">
<view class="brandlsit">
2009年接触葡萄酒。
</view>
<view class="brandlsit">
2010年—2011年在郑大工学院和财经学院任教计算机3D设计教师。
<view class="brandtext" wx:if="{{item.show}}">
<block wx:for="{{artileList2}}" wx:for-item="item" wx:for-index="idx" wx:key=''>
<block wx:if="{{idxs==idx}}">
<template is="wxParse" data="{{wxParseData:item}}" />
</block>
</block>
</view>
<view class="brandlsit">
2012年考取ESW葡萄酒中级品酒师证。
</view>
<view class="brandlsit">
2012年至今在优传葡萄酒有限公司从事葡萄酒销售,酒会承办工作。同时从事企业礼仪茶培训。
</view>
</view>
<!-- 关键词 -->
<view class="keyword" wx:elif="{{selectid==-5}}">
<view class="keyworditem" wx:for="{{jiben}}" wx:key="">{{item.content}}</view>
</view>
<view wx:else>
<view class="brandbox">
<view class="brandboxitem" wx:for="{{othercontent}}" wx:key='' wx:for-index="idxs">
<!-- <view class="boxtop">
<view class="boxtopleft">
{{item.name}}
</view>
<view class="boxright" bindtap="showinfo" data-idx="{{idxs}}">
<image src="{{url}}aicon_53x.png" wx:if="{{item.show}}"></image>
<image src="{{url}}aicon_52x.png" wx:else></image>
</view>
</view> -->
<view class="brandtext" wx:if="{{item.show}}">
<block wx:for="{{artileList4}}" wx:for-item="item" wx:for-index="idx" wx:key=''>
<block wx:if="{{idxs==idx}}">
<template is="wxParse" data="{{wxParseData:item}}" />
</block>
</block>
</view>
</view>
</view>
</view>
<!-- 关键词 -->
<view class='pingjia' bindtap="evalute">
<image src="/img/aicon_29@2x.png"></image>
<view class="keyword" wx:if="{{current==3}}">
<view class="keyworditem">基本参数</view>
<view class="keyworditem">基本参数</view>
<view class="keyworditem">基本参数</view>
<view class="keyworditem">基本参数</view>
<view class="keyworditem">基本参数</view>
<view class="pingcount">{{wineinfo.comment_count}}</view>
<view class="pingname">评价</view>
</view>
\ No newline at end of file
... ...
... ... @@ -18,6 +18,7 @@ page{
background: #fff;
}
.canleft{
width:130rpx;
color:#999999;
font-size: 26rpx;
}
... ... @@ -96,9 +97,74 @@ page{
.slectpic{
width:128rpx;
text-align: center;
padding: 22rpx 0;
padding: 10rpx 0;
box-sizing: border-box;
background: #E81825;
color:#fff;
border-radius:50rpx;
}
.brandboxitem{
background: #fff;
padding-bottom: 20rpx!important;
}
.wujiaoimg{
width:26rpx;
height:24rpx;
font-size: 0;
margin-left:9rpx;
}
.wujiao{
display:flex;
align-items: center;
margin-left:195rpx;
}
.gaunfang{
display:flex;
align-items: center;
padding:31rpx 32rpx;
box-sizing: border-box;
background: #fff;
border-bottom:12rpx solid #F2F2F2;
}
.guanfangtitle{
color:#1A1A1A;
font-size:34rpx;
font-weight: bold;
}
.guanfang{
color:#1A1A1A;
font-size: 22rpx;
margin-left:9rpx;
}
.fen{
color:#666666;
font-size: 24rpx;
margin-left:17rpx;
}
.pingjia{
width:95rpx;
height:114rpx;
font-size: 0;
position: fixed;
bottom:42rpx;
right:35rpx;
}
.pingjia image{
width:100%;
height:100%;
}
.pingcount{
color:#FFFFFF;
font-size:24rpx;
position: fixed;
bottom:113rpx;
right:67rpx;
}
.pingname{
color:#FFFFFF;
font-size:24rpx;
position: fixed;
bottom:81rpx;
right:56rpx;
}
\ No newline at end of file
... ...
... ... @@ -28,8 +28,8 @@ Page({
this.setData({
url: app.globalData.url
})
this.getsearchtext()
},
clear(){
console.log(3478734878)
... ... @@ -39,12 +39,16 @@ Page({
// recordshow: true,
})
this.getkeyword()
this.getlist()
},
//获取搜索内容
getsearchtext(){
let that = this;
let url = '/index/Index/search_default', params = {
let url = 'index/Index/search_default', params = {
sort:that.data.select,
city:wx.getStorageSync('city')
... ... @@ -63,6 +67,13 @@ Page({
})
},
//酒展示
enterwine(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/homeblock/jiuzidian/jiuzidian?id='+id,
})
},
select(e){
this.setData({
select:e.currentTarget.dataset.id,
... ... @@ -84,7 +95,7 @@ Page({
getlist(){
let that = this;
let url = '/index/Index/search', params = {
let url = 'index/Index/search', params = {
sort: that.data.select,
keyword:that.data.keyword,
page:that.data.page
... ... @@ -95,17 +106,14 @@ Page({
searchlistarr:res.list
})
let newsearchlistarr = that.data.searchlistarr;
for (var obj of newsearchlistarr){
obj.sel=false;
}
that.setData({
searchlistarr: newsearchlistarr
})
// let newsearchlistarr = that.data.searchlistarr;
// for (var obj of newsearchlistarr){
// obj.sel=false;
// }
// that.setData({
// searchlistarr: newsearchlistarr
// })
}).catch((err) => {
})
... ... @@ -115,21 +123,6 @@ Page({
collect(e){
let that = this;
let id=e.currentTarget.dataset.id;
let newsearchlistarr = this.data.searchlistarr;
for (var obj of newsearchlistarr){
obj.sel = !obj.sel
if(obj.id==id){
// obj.sel=true
}else{
obj.sel = false
}
}
this.setData({
searchlistarr: newsearchlistarr
})
let url = '/index/Common/favorite', params = {
sort: that.data.select,
id:id
... ... @@ -141,6 +134,32 @@ Page({
icon:'none'
})
that.getlist()
}).catch((err) => {
})
},
//关注和取消关注
attention(e){
let that = this;
let id = e.currentTarget.dataset.id;
let url = '/index/Common/concern', params = {
sort: 1,
id: id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon: 'none'
})
that.getlist()
}).catch((err) => {
... ... @@ -196,6 +215,20 @@ Page({
this.getkeyword()
},
//跳页
jumpbrand(e){
let id=e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/homeblock/brandlist/brandlist?id='+id,
})
},
//酒企
jumpcompany(e){
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/homeblock/companyintro/companyintro?id=' + id,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -207,6 +240,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getlist()
},
... ...
... ... @@ -46,7 +46,7 @@
<view class="textbox">
<view class="seahead" >
<view class="searword" wx:for="{{list}}" wx:key="">{{item.name}}</view>
<view class="searword" wx:for="{{list}}" wx:key="" bindtap="enterwine" data-id="{{item.id}}">{{item.name}}</view>
</view>
... ... @@ -83,7 +83,7 @@
<view class="jiupin" wx:if="{{select==1}}">
<view class="searchitem" wx:for="{{searchlistarr}}" wx:key=''>
<view class="searchitem" wx:for="{{searchlistarr}}" wx:key='' bindtap="jumpbrand" data-id="{{item.id}}">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{item.logo}}"></image>
... ... @@ -101,351 +101,69 @@
</view>
<view class="starimg" catchtap="collect" data-id="{{item.id}}">
<image src="{{url}}aicon_10x.png" wx:if="{{item.sel}}"></image>
<image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
<image src="{{url}}aicon_09x.png" wx:else></image>
</view>
</view>
<!-- <view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<image src="{{url}}aicon_09x.png"></image>
</view>
</view> -->
</view>
<view class="brand" wx:if="{{select==2}}">
<view class="searchitem">
<view class="searchitem" wx:for="{{searchlistarr}}" wx:key='' bindtap="jumpbrand" data-id="{{item.id}}">
<view class="searchitemleft">
<view class="branditemleftimg">
<image src="{{url}}aicon_12@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州福</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="itemidelename">{{item.name}}</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">{{item.sort_name}}</text>
<text class="namebottomitem">{{item.country}}</text>
<text class="namebottomitem">{{item.city}}</text>
<text class="namebottomitem">{{item.odor_name}}</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<image src="{{url}}aicon_09x.png"></image>
</view>
<view class="starimg" catchtap="collect" data-id="{{item.id}}">
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
<image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
<image src="{{url}}aicon_09x.png" wx:else></image>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
</view>
<view class="brand" wx:if="{{select==3}}">
<view class="searchitem">
<view class="searchitem" wx:for="{{searchlistarr}}" wx:key='' bindtap="jumpcompany" data-id="{{item.id}}">
<view class="searchitemleft">
<view class="jiuqiimg">
<image src="{{url}}aicon_13@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州国粹酒业有限公司</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="atten">关注</view>
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="itemidelename">{{item.name}}</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">{{item.country}}</text>
<text class="namebottomitem">{{item.city}}</text>
<text class="namebottomitem">{{item.sort_name}}</text>
<text class="namebottomitem">{{item.concern_count}}关注</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<view class="atten" wx:if="{{item.is_concern==1}}" data-id="{{item.id}}" catchtap="attention">取消关注</view>
<view class="atten" data-id="{{item.id}}" wx:else catchtap="attention">关注</view>
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -167,6 +167,9 @@ image{
padding: 0 20rpx;
border-right:1rpx solid #f5f5f5;
}
.namebottomitem:last-child{
border-right:none;
}
.branditemleftimg{
width:80rpx;
height:80rpx;
... ... @@ -177,7 +180,14 @@ image{
width:80rpx;
height:80rpx;
}
.nambottom .namebottomitem:first-child{
padding-left: 0;
}
.noatten{
width: 100rpx;
height: 50rpx;
background: #999;
border-radius: 2rpx;
font-size: 26rpx;
color: #fff;
text-align: center;
line-height: 50rpx;
}
\ No newline at end of file
... ...
... ... @@ -7,7 +7,9 @@ Page({
* 页面的初始数据
*/
data: {
url:""
url:"",
id:'',
shipaiarr:[]
},
/**
... ... @@ -15,8 +17,31 @@ Page({
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url
url: app.globalData.url,
id:options.wineid
})
this.getshipai()
},
//获取官图
getshipai(){
let that = this;
let url = 'index/Wine/comment_images',
params = {
wine_id: that.data.id,
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
shipaiarr:res.list
})
}).catch((err) => {
})
},
/**
... ...
<view class="containerbox">
<view class="boxitem">
<view class="boxitem" wx:for="{{shipaiarr}}" wx:key=''>
<view class="itemimg">
<image src="{{url}}aicon_90x.png"></image>
<image src="{{item.url}}"></image>
</view>
<view class="itembottom">
<view class="bottomtop">
<view class="bottomleft">
<image src="{{url}}aicon_45@2x.png"></image>
<image src="{{item.avatar}}"></image>
</view>
<text class="leftname">小叶子实打实</text>
<text class="leftname">{{item.user_nickname}}</text>
</view>
<view class="bottomxia">
<view class="xiaimg">
<image src="{{url}}aicon_47x.png"></image>
</view>
<text class="zannum">6.2k</text>
<text class="zannum">{{item.good_count}}</text>
</view>
</view>
</view>
<view class="boxitem">
<view class="itemimg">
<image src="{{url}}aicon_90x.png"></image>
</view>
<view class="itembottom">
<view class="bottomtop">
<view class="bottomleft">
<image src="{{url}}aicon_45@2x.png"></image>
</view>
<text class="leftname">小叶子实打实</text>
</view>
<view class="bottomxia">
<view class="xiaimg">
<image src="{{url}}aicon_47x.png"></image>
</view>
<text class="zannum">6.2k</text>
</view>
</view>
</view>
<view class="boxitem">
<view class="itemimg">
<image src="{{url}}aicon_90x.png"></image>
</view>
<view class="itembottom">
<view class="bottomtop">
<view class="bottomleft">
<image src="{{url}}aicon_45@2x.png"></image>
</view>
<text class="leftname">小叶子实打实</text>
</view>
<view class="bottomxia">
<view class="xiaimg">
<image src="{{url}}aicon_47x.png"></image>
</view>
<text class="zannum">6.2k</text>
</view>
</view>
</view>
<view class="boxitem">
<view class="itemimg">
<image src="{{url}}aicon_90x.png"></image>
</view>
<view class="itembottom">
<view class="bottomtop">
<view class="bottomleft">
<image src="{{url}}aicon_45@2x.png"></image>
</view>
<text class="leftname">小叶子实打实</text>
</view>
<view class="bottomxia">
<view class="xiaimg">
<image src="{{url}}aicon_47x.png"></image>
</view>
<text class="zannum">6.2k</text>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -27,6 +27,9 @@ page{
font-size: 0;
border-radius: 50%;
}
.bottomleft image{
border-radius:50%;
}
.leftname{
color:#666666;
font-size: 28rpx;
... ...
// pages/homeblock/shortvideo/shortvideo.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id:'',
page:1,
list:[],
video:'',
date:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
id:options.wineid
})
this.getshortvideo()
},
//获取短视频
getshortvideo(){
let that = this;
let url = 'index/Wine/comment_video',
params = {
wine_id: that.data.id,
page:that.data.page
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
list: res.list,
video: res.video
})
let newtime = res.video.create_time;
that.formatDate(newtime)
}).catch((err) => {
})
},
formatDate(datetime) {
// 获取年月日时分秒值 slice(-2)过滤掉大于10日期前面的0
var date = new Date(datetime * 1000)
var Y = date.getFullYear() ;
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) ;
var D = (date.getDate() + 1 < 10 ? '0' + (date.getDate()) : date.getDate())
var h = date.getHours() + ':';
var m = date.getMinutes() + ':';
var s = date.getSeconds();
// 拼接
var result = Y + "-" + M + "-" + D
console.log(result)
this.setData({
date:result
})
// 返回
return result;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
<view class="biaozhuantitle">广告片</view>
<view class="biaozhuantitle">{{video.name}}</view>
<video src="/video/vi.mp4" controls class="video" object-fit="fill"></video>
<video src="{{video.url}}" controls class="video" object-fit="fill"></video>
<view class="bofangnum">
<view class="bofangleft">
12.5w次播放
{{video.times}}次播放
</view>
<view class="bofangright">2019-02-26</view>
<view class="bofangright">{{date}}</view>
</view>
<view class="biaozhuantitle xiaovideo">小视频</view>
<view class="shortvideobox">
<view class="videoitem">
<video src="/video/vi.mp4" class="itemvid" controls object-fit="fill"></video>
<view class="videoitem" wx:for='{{list}}' wx:key=''>
<video src="{{item.video}}" class="itemvid" controls object-fit="fill"></video>
<view class="videoittitle">春节大团圆,喝这真的喝这真的喝这真的</view>
<view class="videoittitle">{{item.content}}</view>
<view class="">
</view>
</view>
<view class="videoitem">
<!-- <view class="videoitem">
<video src="/video/vi.mp4" class="itemvid" controls object-fit="fill"></video>
</view>
<view class="videoitem">
... ... @@ -28,7 +28,7 @@
</view>
<view class="videoitem">
<video src="/video/vi.mp4" class="itemvid" controls object-fit="fill"></video>
</view>
</view> -->
... ...
// pages/homeblock/zhinengselect/zhinengselect.js
const app=getApp()
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
url:'',
navarr:[{
name:'用途'
},
{
name: '用途'
url: '',
navarr: [{
name: '用途',
sel: false,
type: 1
},
{
name: '价格'
name: '价格',
sel: false,
type: 2
},
{
name: '包装'
name: '包装',
sel: false,
type: 3
},
{
name: '产区'
name: '产区',
sel: false,
type: 4
}, {
name: '香型'
name: '香型',
sel: false,
type: 5
},
{
name: '评分'
}],
name: '评分',
sel: false,
type: 6
}
],
current:0
current: 0,
zhinengwrap: false,
citychose: false,
use_id: '',
odor_id: '',
package_id: '',
city: '',
score: '',
more: '',
page: '',
type: '',
zhinengarr: [],
zhinenglist: [],
page:1
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
let that = this;
this.setData({
url: app.globalData.url
})
this.getshaicontent()
this.getmorenconetent();
},
select(e) {
let that = this;
let index = e.currentTarget.dataset.idx;
let type = e.currentTarget.dataset.type;
this.setData({
type: type,
})
let newnavarr = this.data.navarr;
for (var i = 0; i < newnavarr.length; i++) {
if (i == index) {
newnavarr[i].sel = !newnavarr[i].sel;
if (type == 4) {
if (newnavarr[i].sel == true) {
console.log(999)
this.setData({
citychose: true,
zhinengwrap: false
})
} else {
this.setData({
citychose: false,
zhinengwrap: false
})
}
} else {
if (newnavarr[i].sel == true) {
console.log(999)
this.setData({
citychose: false,
zhinengwrap: true
})
} else {
this.setData({
citychose: false,
zhinengwrap: false
})
}
}
} else {
newnavarr[i].sel = false
}
}
this.setData({
navarr: newnavarr
})
this.getshaicontent();
this.getmorenconetent();
let newzhinengarr1 = that.data.zhinengarr;
console.log(342347)
console.log(that.data.type);
console.log(newzhinengarr1)
// for (var obj of newzhinengarr1) {
// if (that.data.type == 1) {
// console.log(this.data.use_id)
// if (obj.id = this.data.use_id) {
// obj.sel = true
// }
// this.setData({
// zhinengarr: newzhinengarr1
// })
// } else if (that.data.type == 3) {
// if (obj.id = this.data.package_id) {
// obj.sel = true
// }
// this.setData({
// zhinengarr: newzhinengarr1
// })
// } else if (that.data.type == 4) {
// if (obj.city = this.data.city) {
// obj.sel = true
// }
// this.setData({
// zhinengarr: newzhinengarr1
// })
// } else if (that.data.type == 5) {
// if (obj.id = this.data.odor_id) {
// obj.sel = true
// }
// this.setData({
// zhinengarr: newzhinengarr1
// })
// }
// }
},
//隐藏智能筛选
hidezhineng() {
this.setData({
zhinengwrap: false
})
let newnavarr = this.data.navarr;
for (var obj of newnavarr) {
obj.sel = false
}
this.setData({
navarr: newnavarr
})
},
hide() {
this.setData({
citychose: false
})
let newnavarr = this.data.navarr;
for (var obj of newnavarr) {
obj.sel = false
}
this.setData({
navarr: newnavarr
})
},
//获取筛选内容
getshaicontent() {
let that = this;
let url = 'index/Filter/filter',
params = {
}
app.post(url, params).then((res) => {
console.log(res);
if (that.data.type == 1) {
that.setData({
zhinengarr: res.use
})
let newzhinengarr = that.data.zhinengarr;
for (var obj of newzhinengarr) {
obj.sel = false
}
that.setData({
zhinengarr: newzhinengarr
})
let newzhinengarr1 = that.data.zhinengarr;
for (var obj of newzhinengarr1) {
if (obj.id == that.data.use_id) {
obj.sel = true
}
}
that.setData({
zhinengarr: newzhinengarr1
})
} else if (that.data.type == 2) {
that.setData({
zhinengarr: res.price
})
let newzhinengarr = that.data.zhinengarr;
for (var obj of newzhinengarr) {
obj.sel = false
}
that.setData({
zhinengarr: newzhinengarr
})
} else if (that.data.type == 3) {
that.setData({
zhinengarr: res.packages
})
let newzhinengarr = that.data.zhinengarr;
for (var obj of newzhinengarr) {
obj.sel = false
}
that.setData({
zhinengarr: newzhinengarr
})
let newzhinengarr1 = that.data.zhinengarr;
for (var obj of newzhinengarr1) {
if (obj.id == that.data.package_id) {
obj.sel = true
}
}
that.setData({
zhinengarr: newzhinengarr1
})
} else if (that.data.type == 4) {
that.setData({
zhinengarr: res.city
})
let newzhinengarr = that.data.zhinengarr;
for (var obj of newzhinengarr) {
obj.sel = false
}
that.setData({
zhinengarr: newzhinengarr
})
let newzhinengarr1 = that.data.zhinengarr;
for (var obj of newzhinengarr1) {
if (obj.city == that.data.city) {
obj.sel = true
}
}
that.setData({
zhinengarr: newzhinengarr1
})
} else if (that.data.type == 5) {
that.setData({
zhinengarr: res.odor
})
let newzhinengarr = that.data.zhinengarr;
for (var obj of newzhinengarr) {
obj.sel = false
}
that.setData({
zhinengarr: newzhinengarr
})
let newzhinengarr1 = that.data.zhinengarr;
for (var obj of newzhinengarr1) {
if (obj.id == that.data.odor_id) {
obj.sel = true
}
}
that.setData({
zhinengarr: newzhinengarr1
})
} else if (that.data.type == 6) {
that.setData({
zhinengarr: res.score_list
})
}
}).catch((err) => {
})
},
select(e){
//选择种类
shosekind(e) {
let id = e.currentTarget.dataset.id;
console.log(this.data.type)
let newzhinengarr = this.data.zhinengarr;
for (var obj of newzhinengarr) {
if (obj.id == id) {
if (this.data.type == 1) {
obj.sel = !obj.sel;
if (obj.sel == true) {
this.setData({
use_id: obj.id
})
let newnavarr = this.data.navarr;
newnavarr[0].name = obj.use_name;
this.setData({
navarr: newnavarr
})
} else {
this.setData({
use_id: ''
})
}
this.getmorenconetent()
} else if (this.data.type == 3) {
obj.sel = !obj.sel;
if (obj.sel == true) {
this.setData({
package_id: obj.id
})
let newnavarr = this.data.navarr;
newnavarr[2].name = obj.package_name;
this.setData({
navarr: newnavarr
})
} else {
this.setData({
package_id: ''
})
}
this.getmorenconetent()
} else if (this.data.type == 5) {
obj.sel = !obj.sel;
if (obj.sel == true) {
this.setData({
odor_id: obj.id
})
let newnavarr = this.data.navarr;
newnavarr[4].name = obj.odor_name;
this.setData({
navarr: newnavarr
})
} else {
this.setData({
current:e.currentTarget.dataset.idx
odor_id: ''
})
}
this.getmorenconetent()
}
} else {
obj.sel = false
}
if (this.data.type == 4) {
let cityname = e.currentTarget.dataset.name;
if (obj.city == cityname) {
obj.sel = !obj.sel
if (obj.sel == true) {
this.setData({
city: obj.city,
})
let newnavarr = this.data.navarr;
newnavarr[3].name = obj.city;
this.setData({
navarr: newnavarr
})
} else {
this.setData({
city: ''
})
}
} else {
obj.sel = false
}
this.getmorenconetent()
}
}
this.setData({
zhinengarr: newzhinengarr
})
},
//获取默认数据
getmorenconetent() {
let that = this;
let url = 'index/Filter/index',
params = {
use_id: that.data.use_id,
odor_id: that.data.odor_id,
pce:that.data.price,
package_id: that.data.package_id,
city: that.data.city,
score: that.data.score,
more: that.data.more,
page: that.data.page
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
zhinenglist: res.list
})
}).catch((err) => {
})
},
//收藏
collect(e) {
let that = this;
let id = e.currentTarget.dataset.id
let url = 'index/Common/favorite',
params = {
sort: 1,
id: id
}
app.post(url, params).then((res) => {
wx.showToast({
title: res,
icon: 'none'
})
that.getmorenconetent()
}).catch((err) => {
})
console.log(this.data.current)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
<view class="register">
<view class="registerwrap">
<view class="registeritem">浓香型</view>
<view class="registeritem">浓香型</view>
<view class="registeritem">浓香型</view>
<view class="registeritem">浓香型</view>
<view class="registeritem">浓香型</view>
<view class="registeritem">浓香型</view>
</view>
</view>
<!-- 筛选内容 -->
<view class="register" wx:if="{{zhinengwrap}}" bindtap="hidezhineng">
<view class="registerwrap" catchtap="">
<view class="registeritem {{item.sel==true?'choseactive':''}}" wx:if="{{type==1}}" wx:for="{{zhinengarr}}" wx:key="" catchtap="shosekind" data-id="{{item.id}}">{{item.use_name}}</view>
<view class="registeritem" wx:if="{{type==2}}" wx:for="{{zhinengarr}}" wx:key="">浓香型</view>
<view class="registeritem {{item.sel==true?'choseactive':''}}" wx:if="{{type==3}}" wx:for="{{zhinengarr}}" wx:key="" catchtap="shosekind" data-id="{{item.id}}">{{item.package_name}}</view>
<view class="registeritem {{item.sel==true?'choseactive':''}}" wx:if="{{type==5}}" wx:for="{{zhinengarr}}" wx:key="" catchtap="shosekind" data-id="{{item.id}}">{{item.odor_name}}</view>
<view class="registeritem" wx:if="{{type==6}}" wx:for="{{zhinengarr}}" wx:key="">浓香型</view>
<view class="shaisel">
<view class="kind">
<view class="shaikind" wx:for="{{navarr}}" wx:key='' bindtap="select" data-idx="{{index}}">
<view class="shaikindname {{current==index?'selactive':''}}">{{item.name}}</view>
<view class="shaikindimg">
<image src="{{current==index?'http://winesbook.cn/static/images_mini/aicon_16@2x.png':'http://winesbook.cn/static/images_mini/aicon_14x.png'}}"></image>
</view>
</view>
<!-- <view class="shaikind">
<view class="shaikindname">价格</view>
<view class="shaikindimg">
<image src="{{url}}aicon_14x.png"></image>
</view>
</view>
<view class="shaikind">
<view class="shaikindname">包装</view>
<view class="shaikindimg">
<image src="{{url}}aicon_14x.png"></image>
</view>
</view>
<view class="shaikind">
<view class="shaikindname">产区</view>
<view class="shaikindimg">
<image src="{{url}}aicon_14x.png"></image>
</view>
</view>
<!-- 城市筛选 -->
<view class="register" wx:if="{{citychose}}" bindtap="hide">
<view class="registerwrap">
<view class="citylist" catchtap="shosekind" data-id="{{item.id}}" wx:for="{{zhinengarr}}" wx:key="" data-name="{{item.city}}">
<view class="cityitem">{{item.city}}</view>
<view class="gouimg" wx:if="{{item.sel==true}}">
<image src="{{url}}/aicon_18x.png"></image>
</view>
<view class="shaikind">
<view class="shaikindname">香型</view>
<view class="shaikindimg">
<image src="{{url}}aicon_14x.png"></image>
</view>
</view>
<view class="shaikind">
<view class="shaikindname">产区</view>
</view>
<view class="shaisel">
<view class="kind">
<view class="shaikind" wx:for="{{navarr}}" wx:key='' bindtap="select" data-idx="{{index}}" data-type="{{item.type}}">
<view class="shaikindname {{item.sel==true?'selactive':''}}">{{item.name}}</view>
<view class="shaikindimg">
<image src="{{url}}aicon_14x.png"></image>
<image src="{{item.sel==true?'http://winesbook.cn/static/images_mini/aicon_16@2x.png':'http://winesbook.cn/static/images_mini/aicon_14x.png'}}"></image>
</view>
</view>
<view class="shaikind">
<view class="shaikindname">评分</view>
<view class="shaikindimg">
<image src="{{url}}aicon_14x.png"></image>
</view>
</view> -->
</view>
<view class="more">
<image src="{{url}}aicon_15x.png"></image>
</view>
... ... @@ -66,125 +41,35 @@
</view>
<view class="zhinengbox">
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
<view class="searchitem">
<view class="nodata" wx:if="{{zhinenglist.length==0}}">暂无数据</view>
<block wx:else>
<view class="searchitem" wx:for="{{zhinenglist}}" wx:key="">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
<image src="{{item.logo}}"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="itemidelename">{{item.name}}</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">{{item.degree_name}}</text>
<text class="namebottomitem">{{item.odor_name}}</text>
<text class="namebottomitem">官方价{{item.price}}元</text>
<text class="namebottomitem">{{item.ml}}</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<image src="{{url}}aicon_09x.png"></image>
</view>
<view class="starimg" bindtap="collect" data-id="{{item.id}}">
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<image src="{{url}}aicon_09x.png"></image>
</view>
</view>
<view class="searchitem">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{url}}aicon_11@2x.png"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">泸州迎宾酒</view>
<view class="nambottom">
<text class="namebottomitem">53°</text>
<text class="namebottomitem">浓香型</text>
<text class="namebottomitem">53°</text>
<text class="namebottomitem">53°</text>
</view>
</view>
</view>
<view class="starimg">
<!-- aicon_010x.png -->
<image src="{{url}}aicon_09x.png"></image>
<image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
<image src="{{url}}aicon_09x.png" wx:else></image>
</view>
</view>
</block>
</view>
\ No newline at end of file
... ...