作者 朱振飞

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

正在显示 74 个修改的文件 包含 3147 行增加601 行删除
{
"pages": [
"pages/login/login",
"pages/homapage/homepage",
"pages/forgetmima/forgetmima",
"pages/setmima/setmima",
"pages/myblock/shezhimima/shezhimima",
"pages/enteryanzheng/enteryanzheng",
"pages/login/login",
"pages/homeblock/zhinengselect/zhinengselect",
"pages/homeblock/search/search",
"pages/find/find",
... ... @@ -24,14 +28,11 @@
"pages/myblock/huanbangshouji/huanbangshouji",
"pages/myblock/guanzhu/guanzhu",
"pages/myblock/pinglun/pinglun",
"pages/enteryanzheng/enteryanzheng",
"pages/forgetmima/forgetmima",
"pages/wanshangeren/wanshangeren",
"pages/peopleinfo/peopleinfo",
"pages/myblock/jifenjilu/jifenjilu",
"pages/myblock/pingjia/pingjia",
"pages/myblock/niangjiulist/niangjiulist",
"pages/myblock/shezhimima/shezhimima",
"pages/homeblock/video/video",
"pages/homeblock/shuxing/shuxing",
"pages/homeblock/selectcity/selectcity",
... ... @@ -49,7 +50,9 @@
"pages/myblock/about/about",
"pages/findblock/meirixinjiu/meirixinjiu",
"pages/findblock/jiulist/jiulist",
"pages/findblock/putongwenzhang/putongwenzhang"
"pages/findblock/putongwenzhang/putongwenzhang",
"pages/findblock/wenzhangdetail/wenzhangdetail",
"pages/homeblock/bofangexample/bofangexample"
],
"window": {
"backgroundTextStyle": "light",
... ...
... ... @@ -76,24 +76,29 @@ image {
line-height: 50rpx;
}
/* 上三角 */
/* 上三角 */
.boxright{
width:26rpx;
height:15rpx;
font-size: 0
}
.noData{
height: 360rpx;
width: 750rpx;
text-align: center;
display: flex;
align-items: center;
font-size: 26rpx;
color: #999;
justify-content: center;
}
.nodata{
color:#999;
font-size: 30rpx;
text-align: center;
margin-top:30rpx;
}
.boxright {
width: 26rpx;
height: 15rpx;
font-size: 0;
}
.noData {
height: 360rpx;
width: 750rpx;
text-align: center;
display: flex;
align-items: center;
font-size: 26rpx;
color: #999;
justify-content: center;
}
.showall {
color: #999;
... ...
// pages/enteryanzheng/enteryanzheng.js
let interval = null;
const app=getApp()
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
Length: 6, //输入框个数
isFocus: true, //聚焦
Value: "", //输入的内容
Length: 6, //输入框个数
isFocus: true, //聚焦
Value: "", //输入的内容
ispassword: true,
currentTime: 60,
time:'',
phonenum:''
time: '',
phonenum: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
console.log(options.phonenum)
this.setData({
phonenum:options.phonenum
phonenum: options.phonenum,
type:options.type,
id:options.id
})
this.getcode()
},
//获取验证码
getcode(){
getcode() {
let that = this;
let currentTime = that.data.currentTime;
that.setData({
disable: true
})
interval = setInterval(function () {
interval = setInterval(function() {
currentTime--;
that.setData({
time: currentTime + 's后再次发送',
... ... @@ -74,15 +76,15 @@ Page({
})
},
entercode(){
if (this.data.time == '重新发送'){
entercode() {
if (this.data.time == '重新发送') {
this.getcode()
}
},
Focus(e) {
var that = this;
let arr=that.data.arr;
let arr = that.data.arr;
console.log(e.detail.value.length);
// arr.push(e.detail.value);
... ... @@ -93,27 +95,47 @@ Page({
len: e.detail.value.length
})
if (that.data.Value.length==6){
if (that.data.Value.length == 6) {
that.yanzhenglogin()
}
},
yanzhenglogin(){
let that=this;
yanzhenglogin() {
let that = this;
var url = '/user/Profile/bind_mobile';
var params = {
mobile: that.data.phonenum,
verification_code:that.data.Value
verification_code: that.data.Value
}
app.post(url, params).then((res) => {
console.log(res);
wx.setStorageSync('token', res.token)
wx.switchTab({
url: '/pages/homapage/homepage',
})
if (res.is_password == 0) {
wx.navigateTo({
url: '/pages/setmima/setmima',
})
} else {
if(that.data.type==1){
let url = wx.getStorageSync("url")
wx.navigateTo({
url: url+'?id=' + that.data.id,
})
} else if (that.data.type == 2){
let url = wx.getStorageSync("url")
wx.navigateTo({
url: url + '?id=' + that.data.id,
})
}else{
wx.switchTab({
url: '/pages/homapage/homepage',
})
}
}
}).catch((err) => {
console.log(err)
... ... @@ -138,49 +160,49 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
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
... ...
... ... @@ -10,7 +10,7 @@
</view>
<input name="password" password="{{true}}" class='ipt' maxlength="{{Length}}" focus="{{isFocus}}" bindinput="Focus"></input>
<input name="number" password="{{true}}" class='ipt' maxlength="{{Length}}" focus="{{isFocus}}" bindinput="Focus"></input>
<view class="daojishi" bindtap="entercode">{{time}}</view>
... ...
... ... @@ -64,6 +64,7 @@ Page({
//跳页
jump(e){
let type=e.currentTarget.dataset.type;
let id=e.currentTarget.dataset.id
console.log(type)
if(type==1){
wx.navigateTo({
... ... @@ -79,7 +80,7 @@ Page({
})
} else if (type == 4){
wx.navigateTo({
url: '/pages/findblock/putongwenzhang/putongwenzhang',
url: '/pages/findblock/putongwenzhang/putongwenzhang?id='+id,
})
}
},
... ... @@ -135,6 +136,38 @@ Page({
url: '/pages/myblock/pingjia/pingjia?type=' + type + '&id=' + id + '&winemaker_id=' + winemaker_id,
})
},
//新闻详情页
jumpnewdetail(e){
let id=e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/homeblock/jiuzidian/jiuzidian?id=' + id,
})
},
//酒单推荐详情页
enterdetail(e){
let id=e.currentTarget.dataset.id;
let type=e.currentTarget.dataset.type;
let winemaker_id = e.currentTarget.dataset.winemaker_id
if(type==1){
wx.navigateTo({
url: '/pages/findblock/jiudandetail/jiudandetail?id=' + id,
})
}else if(type==2){
wx.navigateTo({
url: '/pages/findblock/zhuanjiapinjiudetail/zhuanjiapinjiudetail?id=' + id,
})
}else if(type==3){
wx.navigateTo({
url: '/pages/homeblock/niangjiuteacher/niangjiuteacher?id=' + winemaker_id,
})
}else{
wx.navigateTo({
url: '/pages/findblock/wenzhangdetail/wenzhangdetail?id=' + id,
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -180,7 +213,42 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function (e) {
let that = this;
console.log(e)
let id=e.target.dataset.id;
console.log(id)
let type=e.target.dataset.type;
let url=''
let winemaker_id = e.target.dataset.winemaker_id;
if(type==1){
url = '/pages/findblock/jiudandetail/jiudandetail?id=' + id
}else if(type==2){
url = '/pages/findblock/zhuanjiapinjiudetail/zhuanjiapinjiudetail?id=' + id
}else if(type==3){
url = '/pages/homeblock/niangjiuteacher/niangjiuteacher?id=' + winemaker_id
}else if(type==4){
url = '/pages/findblock/wenzhangdetail/wenzhangdetail?id=' + id
}
return {
title: '发现', // 转发后 所显示的title
// path: '/pages/home/buildtextdetail/buildtextdetail?buildid='+buildid+'&gettoken='+newtoken, // 相对的路径
path: url,//建档攻略分享1
// path:'',
success: (res) => { // 成功后要做的事情
console.log(res)
},
fail: function (res) {
// 分享失败
console.log(res)
}
}
}
})
\ No newline at end of file
... ...
<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.image}}" data-index='{{index}}' class="slide-image" bindtap='viewImg' width="355" height="150" />
<swiper-item >
<image src="{{item.image}}" data-index='{{index}}' class="slide-image" width="355" height="150" />
</swiper-item>
</block>
</swiper>
... ... @@ -34,7 +34,7 @@
</view>
<view class="dayjiu" bindtap="everyjiu">
<view class="tast" wx:for="{{news}}" wx:key=''>
<view class="tast" wx:for="{{news}}" wx:key='' catchtap="jumpnewdetail" data-id="{{item.wine_id}}">
<view class="tastimg">
<image src="{{item.thumb}}"></image>
</view>
... ... @@ -48,7 +48,7 @@
</view>
<view class="wineblock" wx:for="{{list}}" wx:key="" bindtap="jump" data-type="{{item.type}}">
<view class="wineblock" wx:for="{{list}}" wx:key="" bindtap="jump" data-type="{{item.type}}" data-id="{{item.id}}">
<view class="middlehead">
<view class="rilihead">
<view class="rili">
... ... @@ -67,18 +67,18 @@
</view>
</view>
<view class="winetitle">{{item.article.share_content}}</view>
<view class="winetitle" catchtap='enterdetail' data-id="{{item.article.id}}" data-type="{{item.type}}">{{item.article.share_content}}</view>
<view class="wineimg" wx:if="{{item.type==2}}" data-url="{{item.article.video}}" catchtap='entervideo'>
<view class="wineimg" wx:if="{{item.type==2}}" data-url="{{item.article.video}}" catchtap='entervideo' catchtap='enterdetail' data-id="{{item.article.id}}" data-type="{{item.type}}">
<image src="{{item.article.video_image}}"></image>
<view class="vioimg">
<image src="{{url}}/aicon_70x.png"></image>
</view>
</view>
<view class="wineimg" wx:else>
<view class="wineimg" wx:else catchtap='enterdetail' data-id="{{item.article.id}}" data-type="{{item.type}}" data-winemaker_id="{{item.article.winemaker_id}}">
<image src="{{item.article.thumb}}"></image>
</view>
... ... @@ -108,9 +108,11 @@
</view>
<view class="winerighttou">
<view class="winerighttouimg">
<view class="winerighttouimg" catchtap='share'>
<image src="{{url}}aicon_68x.png"></image>
<button class="lj_share" bindtap="buildshare" open-type='share' data-id="{{item.article.id}}" data-type="{{item.type}}" data-winemaker_id="{{item.article.winemaker_id}}"></button>
</view>
</view>
</view>
... ...
... ... @@ -14,7 +14,7 @@
width:100%;
height:100%;
/* box-shadow:0px -1px 6px 0px rgba(212,137,96,0.11); */
border-radius:10px;
/* border-radius:10px; */
}
.swiper_item_img swiper-item{
width:750rpx;
... ... @@ -193,7 +193,22 @@ image{
.winerighttouimg{
width:30rpx;
height:28rpx;
font-size: 0
font-size: 0;
position:relative;
}
.lj_share{
width:60rpx;
height:40rpx;
border:none;
position: absolute;
right:0;
top:0;
background: transparent
}
button::after{
border:none;
background: transparent
}
.winerighttou{
display:flex;
... ...
... ... @@ -6,7 +6,11 @@ Page({
* 页面的初始数据
*/
data: {
url:''
url:'',
id:'',
page:1,
rec_list:[],
info:""
},
/**
... ... @@ -14,10 +18,136 @@ Page({
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url
url: app.globalData.url,
id:options.id
})
let token=wx.getStorageSync("token");
if(token==''){
wx.navigateTo({
url: '/pages/login/login?id='+this.data.id+'&type='+1,//type=1发现的首页酒单推荐
})
wx.setStorageSync("url", "/pages/findblock/jiudandetail/jiudandetail")
}
},
//获取酒单详情
getjiudandetail(){
let that = this;
let url = 'index/Find/rec_detail', params = {
id:that.data.id,
page:that.data.page
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
rec_list: that.data.rec_list.concat(res.info.rec_list),
info:res.info
})
console.log(that.data.rec_list)
}).catch((err) => {
})
},
//收藏
collect(e){
let id=e.currentTarget.dataset.id;
let that = this;
let url = 'index/Common/favorite', params = {
sort:3,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
that.getjiudandetail()
}).catch((err) => {
})
},
//评论
pinglun(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/myblock/pingjia/pingjia?id='+id+'&type='+1,
})
},
//点赞
dianzan(e){
let id=e.currentTarget.dataset.id;
let that = this;
let url = 'index/Common/good', params = {
sort:1,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
that.getjiudandetail()
}).catch((err) => {
})
},
//酒单收藏
scollect(e){
let id=e.currentTarget.dataset.id;
let that = this;
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'
})
let newrec_list = that.data.rec_list;
for (var obj of newrec_list){
if(obj.id==id){
if (obj.is_favorite == 0) {
obj.is_favorite = 1
} else {
obj.is_favorite = 0
}
}
}
that.setData({
rec_list: newrec_list
})
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
... ... @@ -30,7 +160,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getjiudandetail()
},
/**
... ... @@ -58,13 +188,38 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let page=this.data.page;
page++;
this.setData({
page:page
})
this.getjiudandetail()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let that=this;
let url = '/pages/findblock/jiudandetail/jiudandetail?id='+ that.data.id
return {
title: '发现', // 转发后 所显示的title
// path: '/pages/home/buildtextdetail/buildtextdetail?buildid='+buildid+'&gettoken='+newtoken, // 相对的路径
path: url,//建档攻略分享1
// path:'',
success: (res) => { // 成功后要做的事情
console.log(res)
},
fail: function (res) {
// 分享失败
console.log(res)
}
}
}
})
\ No newline at end of file
... ...
... ... @@ -3,41 +3,45 @@
<view class="jiudandetailhead">
<view class="edtaileft">
<view class="edtaileftimg">
<image src="{{url}}/aicon_77@2x.png"></image>
<image src="{{info.avatar}}"></image>
</view>
<view class="editmiddle">
<view class="middletop">万丈红尘一人醉</view>
<view class="middlebottom">lv12</view>
<view class="middletop">{{info.user_nickname}}</view>
<view class="middlebottom">lv{{info.level}}</view>
</view>
</view>
<view class="atten">关注</view>
<!-- <view class="atten">关注</view> -->
</view>
<view class="jiudanfen">
<view class="jiudanfenitem">
<view class="jiudanfenimg">
<image src="{{url}}/aicon_09x.png"></image>
<view class="jiudanfenimg" bindtap="collect" data-id="{{info.user_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 class="collect">收藏</view>
</view>
<view class="jiudanfenitem">
<view class="jiudanfenimg zhuan">
<image src="{{url}}/aicon_68x.png"></image>
<button class="lj_share" catchtap="buildshare" open-type='share'></button>
</view>
<view class="collect">转发</view>
</view>
<view class="jiudanfenitem">
<view class="jiudanfenitem" bindtap="pinglun" data-id="{{info.id}}">
<view class="jiudanfenimg">
<image src="{{url}}/aicon_67x.png"></image>
</view>
<view class="collect">54</view>
<view class="collect">{{info.comment_count}}</view>
</view>
<view class="jiudanfenitem">
<view class="jiudanfenitem" bindtap="dianzan" data-id="{{info.user_id}}">
<view class="jiudanfenimg">
<image src="{{url}}/aicon_66x.png"></image>
<image src="{{url}}/aicon_46x.png" wx:if="{{info.is_good==1}}"></image>
<image src="{{url}}/aicon_47x.png" wx:else></image>
</view>
<view class="collect">362</view>
<view class="collect">{{info.good_count}}</view>
</view>
</view>
... ... @@ -46,24 +50,24 @@
<view class="jiupin" >
<view class="searchitem" >
<view class="searchitem" wx:for="{{rec_list}}" wx:key=''>
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{item.logo}}"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">222</view>
<view class="itemidelename">{{item.name}}</view>
<view class="nambottom">
<text class="namebottomitem">sadf</text>
<text class="namebottomitem">asf</text>
<text class="namebottomitem">ds</text>
<text class="namebottomitem">d</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" catchtap="collect" data-id="{{item.id}}">
<view class="starimg" catchtap="scollect" data-id="{{item.id}}">
<image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
<image src="{{url}}aicon_09x.png" wx:else></image>
... ...
... ... @@ -9,13 +9,18 @@
.edtaileftimg{
width:96rpx;
height:96rpx;
font-size: 0
font-size: 0;
border-radius:50%;
}
image{
width:100%;
height:100%;
}
.edtaileftimg image{
border-radius: 50%;
}
.edtaileft{
display:flex;
align-items: center;
... ... @@ -52,12 +57,14 @@ image{
.jiudanfenimg{
width:42rpx;
height:40rpx;
font-size: 0
font-size: 0;
position: relative
}
.collect{
color:#666666;
font-size: 28rpx;
margin-top:13rpx;
text-align: center
}
.jiudanfenitem:first-child{
margin-left:20rpx;
... ... @@ -137,4 +144,18 @@ image{
text-align: center;
line-height: 50rpx;
}
\ No newline at end of file
}
.lj_share{
width:45rpx;
height:50rpx;
border:none;
position: absolute;
right:0;
top:0;
background: transparent
}
button::after{
border:none;
outline:none;
}
\ No newline at end of file
... ...
... ... @@ -127,10 +127,28 @@ Page({
}
app.post(url, params).then((res) => {
console.log(res);
// wx.showToast({
// title: res,
// icon:'none'
// })
wx.showToast({
title: res,
icon:'none'
})
let newpeoplelist = that.data.peoplelist
for (var obj of newpeoplelist) {
for (var p of obj.list) {
if (p.user_id == id) {
if (p.is_favorite==0){
p.is_favorite=1
}else{
p.is_favorite = 0
}
}
}
}
that.setData({
peoplelist: newpeoplelist
})
... ... @@ -146,6 +164,13 @@ Page({
url: '/pages/myblock/pingjia/pingjia?id='+id+'&type='+this.data.type,
})
},
//进入详情页
detail(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/findblock/jiudandetail/jiudandetail?id='+id,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -201,7 +226,30 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function (e) {
let that = this;
console.log(e)
let id = e.target.dataset.id;
console.log(id)
let url = '/pages/findblock/jiudandetail/jiudandetail?id=' + id
return {
title: '发现', // 转发后 所显示的title
// path: '/pages/home/buildtextdetail/buildtextdetail?buildid='+buildid+'&gettoken='+newtoken, // 相对的路径
path: url,//建档攻略分享1
// path:'',
success: (res) => { // 成功后要做的事情
console.log(res)
},
fail: function (res) {
// 分享失败
console.log(res)
}
}
}
})
\ No newline at end of file
... ...
<view class="wineblock" wx:for="{{peoplelist}}" wx:key=''>
<view class="date">{{item.date}}</view>
<view class='wine_list' >
<view class='list_item' wx:for="{{item.list}}" wx:key="">
<view class='list_item' wx:for="{{item.list}}" wx:key="" bindtap="detail" data-id="{{item.id}}">
<view class='img_box'>
<image src='{{item.avatar}}'></image>
</view>
<view class='wine_title'>{{item.title}}</view>
<view class='wine_name'>{{item.user_nickname}}</view>
<view class='wine_leavel'>{{item.level}}</view>
<view class='wine_leavel'>lv{{item.level}}</view>
<view class='action_box'>
<view class='single_action' bindtap="zan" data-id="{{item.user_id}}">
<view class='single_action' catchtap="zan" data-id="{{item.user_id}}">
<view class='zan_icon'>
<image src='/img/aicon_46.png' mode='widthFix' wx:if="{{item.is_good==1}}"></image>
<image src='/img/aicon_47.png' mode='widthFix' wx:else></image>
</view>
{{item.good_count}}
</view>
<view class='single_action' bindtap="pinglun" data-id="{{item.id}}">
<view class='single_action' catchtap="pinglun" data-id="{{item.id}}">
<view class='zan_icon'>
<image src='/img/aicon_67.png' mode='widthFix'></image>
</view>
{{item.comment_count}}
</view>
<view class='single_action {{item.choose?"active":""}}' bindtap='shareAction' data-id="{{item.id}}">
<view class='single_action {{item.choose?"active":""}}' catchtap='shareAction' data-id="{{item.id}}">
<image src='/img/gengduo.png' mode='widthFix' class='moreIcon'></image>
<view class='min_action_box'>
<view class='action_btn' wx:if="{{item.is_favorite==0}}" bindtap="collect" data-id="{{item.user_id}}">收藏</view>
<view class='action_btn' wx:else bindtap="collect" data-id="{{item.user_id}}">取消收藏</view>
<view class='action_btn' wx:if="{{item.is_favorite==0}}" catchtap="collect" data-id="{{item.user_id}}">收藏</view>
<view class='action_btn yishou' wx:else catchtap="collect" data-id="{{item.user_id}}">已收藏</view>
<view class='action_btn'>分享</view>
<button class="lj_share" catchtap="buildshare" open-type='share' data-id="{{item.id}}" ></button>
</view>
</view>
</view>
... ...
... ... @@ -92,6 +92,7 @@ page{
border-radius: 5rpx;
box-shadow:0px 8px 16px 0px rgba(44,49,63,0.1);
display: none;
}
.action_btn{
width: 100%;
... ... @@ -121,4 +122,23 @@ page{
background: #F2F2F2;
color:#666666;
font-size: 24rpx;
}
.yishou{
color:#E81825;
}
.lj_share{
width:94rpx;
height:57rpx;
border:none;
position: absolute;
right:20rpx;
bottom:20rpx;
background: transparent
}
button::after{
border:none;
outline: none;
background: transparent
}
\ No newline at end of file
... ...
... ... @@ -57,14 +57,39 @@ Page({
icon:'none'
})
that.getwinelist()
let newwinelist = that.data.winelist;
console.log(newwinelist)
for(var obj of newwinelist){
for(var p of obj.list){
if (p.wine_id == id) {
if (p.is_favorite == 0) {
p.is_favorite = 1
} else {
p.is_favorite = 0
}
}
}
}
that.setData({
winelist: newwinelist
})
}).catch((err) => {
})
},
jump(e){
let id=e.currentTarget.dataset.id;
console.log(id)
wx.navigateTo({
url: '/pages/homeblock/jiuzidian/jiuzidian?id=' + id,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -2,7 +2,7 @@
<view class="date">{{item.date}}</view>
<view class="searchitem" wx:for="{{item.list}}" wx:key="">
<view class="searchitem" wx:for="{{item.list}}" wx:key="" bindtap="jump" data-id="{{item.wine_id}}">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{item.thumb}}"></image>
... ...
... ... @@ -6,7 +6,9 @@ Page({
* 页面的初始数据
*/
data: {
url:''
url:'',
page:1,
list:[]
},
/**
... ... @@ -16,6 +18,127 @@ Page({
this.setData({
url: app.globalData.url
})
},
//获取酿酒大师列表
getniangju(){
let that = this;
let url = 'index/Find/master_list', params = {
page: that.data.page
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
list:that.data.list.concat(res.list)
})
}).catch((err) => {
})
},
//关注
atten(e){
let id=e.currentTarget.dataset.id;
let that = this;
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'
})
let newlist=that.data.list;
for(var obj of newlist){
if (obj.winemaker_id==id){
if (obj.is_concern==0){
obj.is_concern=1
}else{
obj.is_concern=0
}
}
}
that.setData({
list:newlist
})
}).catch((err) => {
})
},
//点赞和取消点赞
zan(e){
let that = this;
let id = e.currentTarget.dataset.id;
let url = 'index/Common/good', params = {
id:id,
sort:3
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
let newlist=that.data.list;
for(var obj of newlist){
if (obj.winemaker_id==id){
if (obj.is_good==0){
obj.is_good=1;
obj.good_count = obj.good_count+1
}else{
obj.is_good = 0;
if (obj.good_count==0){
obj.good_count=0
}else{
obj.good_count = obj.good_count-1
}
}
}
}
that.setData({
list:newlist
})
}).catch((err) => {
})
},
//评论
ping(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/myblock/pingjia/pingjia?winemaker_id='+id+'&type='+3,
})
},
//酿酒大师详情
niangjiuteacherdetail(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/homeblock/niangjiuteacher/niangjiuteacher?id='+id,
})
},
/**
... ... @@ -29,7 +152,11 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
page:1,
list:[]
})
this.getniangju()
},
/**
... ... @@ -57,13 +184,40 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let page=this.data.page;
page++;
this.setData({
page:page
})
this.getniangju()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function (e) {
let that = this;
let id = e.target.dataset.id;
let url = '/pages/homeblock/niangjiuteacher/niangjiuteacher?id=' + id
return {
title: '发现', // 转发后 所显示的title
// path: '/pages/home/buildtextdetail/buildtextdetail?buildid='+buildid+'&gettoken='+newtoken, // 相对的路径
path: url,//建档攻略分享1
// path:'',
success: (res) => { // 成功后要做的事情
console.log(res)
},
fail: function (res) {
// 分享失败
console.log(res)
}
}
}
})
\ No newline at end of file
... ...
<view class="niangjiulist">
<view class="niangjiuitem">
<view class="teachimg">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="jiuname">徐强</view>
<view class="atten">关注</view>
<view class="jiubottom">
<view class="jiuleft">
<view class="jiuleftimg">
<image src="{{url}}/aicon_66x.png"></image>
</view>
<view class="jiuzan">618</view>
</view>
<view class="jiumiddle">
<view class="middleimg">
<image src="{{url}}/aicon_67x.png"></image>
</view>
<view class="tiao">54</view>
</view>
<view class="jiuright">
<image src="{{url}}/aicon_68x.png"></image>
</view>
</view>
</view>
<view class="niangjiuitem">
<view class="teachimg">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="jiuname">徐强</view>
<view class="atten">关注</view>
<view class="jiubottom">
<view class="jiuleft">
<view class="jiuleftimg">
<image src="{{url}}/aicon_66x.png"></image>
</view>
<view class="jiuzan">618</view>
</view>
<view class="jiumiddle">
<view class="middleimg">
<image src="{{url}}/aicon_67x.png"></image>
</view>
<view class="tiao">54</view>
</view>
<view class="jiuright">
<image src="{{url}}/aicon_68x.png"></image>
</view>
</view>
</view>
<view class="niangjiuitem">
<view class="teachimg">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="jiuname">徐强</view>
<view class="atten">关注</view>
<view class="jiubottom">
<view class="jiuleft">
<view class="jiuleftimg">
<image src="{{url}}/aicon_66x.png"></image>
</view>
<view class="jiuzan">618</view>
</view>
<view class="jiumiddle">
<view class="middleimg">
<image src="{{url}}/aicon_67x.png"></image>
</view>
<view class="tiao">54</view>
</view>
<view class="jiuright">
<image src="{{url}}/aicon_68x.png"></image>
</view>
</view>
</view>
<view class="niangjiuitem">
<view class="teachimg">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="jiuname">徐强</view>
<view class="atten">关注</view>
<view class="jiubottom">
<view class="jiuleft">
<view class="jiuleftimg">
<image src="{{url}}/aicon_66x.png"></image>
</view>
<view class="jiuzan">618</view>
</view>
<view class="jiumiddle">
<view class="middleimg">
<image src="{{url}}/aicon_67x.png"></image>
</view>
<view class="tiao">54</view>
</view>
<view class="jiuright">
<image src="{{url}}/aicon_68x.png"></image>
</view>
</view>
</view>
<view class="niangjiuitem">
<view class="teachimg">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="jiuname">徐强</view>
<view class="atten">关注</view>
<view class="jiubottom">
<view class="jiuleft">
<view class="jiuleftimg">
<image src="{{url}}/aicon_66x.png"></image>
</view>
<view class="jiuzan">618</view>
</view>
<view class="jiumiddle">
<view class="middleimg">
<image src="{{url}}/aicon_67x.png"></image>
</view>
<view class="tiao">54</view>
</view>
<view class="jiuright">
<image src="{{url}}/aicon_68x.png"></image>
</view>
</view>
</view>
</view>
\ No newline at end of file
<view class="niangjiuitem" wx:for="{{list}}" wx:key="" bindtap="niangjiuteacherdetail" data-id="{{item.winemaker_id}}">
<view class="teachimg">
<image src="{{item.avatar}}"></image>
</view>
<view class="jiuname">{{item.name}}</view>
<view class="atten" wx:if="{{item.is_concern==0}}" catchtap="atten" data-id="{{item.winemaker_id}}">关注</view>
<view class="atten aten1" wx:else catchtap="atten" data-id="{{item.winemaker_id}}">取消关注</view>
<view class="jiubottom">
<view class="jiuleft">
<view class="jiuleftimg" catchtap="zan" data-id="{{item.winemaker_id}}">
<image src="{{url}}/aicon_47x.png" wx:if="{{item.is_good==0}}"></image>
<image src="{{url}}/aicon_46x.png" wx:else></image>
</view>
<view class="jiuzan">{{item.good_count}}</view>
</view>
<view class="jiumiddle" catchtap="ping" data-id="{{item.winemaker_id}}">
<view class="middleimg">
<image src="{{url}}/aicon_67x.png"></image>
</view>
<view class="tiao">{{item.comment_count}}</view>
</view>
<view class="jiuright">
<image src="{{url}}/aicon_68x.png"></image>
<button class="lj_share" bindtap="buildshare" open-type='share' data-id="{{item.winemaker_id}}" ></button>
</view>
</view>
</view>
</view>
... ...
... ... @@ -12,7 +12,7 @@
}
.teachimg image{
width:100%;
width:100%;
height:100%;
border-radius:50%;
}
... ... @@ -32,9 +32,14 @@
margin-top:14rpx;
}
.atten{
width:100rpx;
width:80rpx;
/* padding: 0 20 */
margin:20rpx auto 0;
}
.aten1{
width:120rpx;
margin:20rpx auto 0;
}
.jiubottom{
display:flex;
align-items: center;
... ... @@ -76,5 +81,22 @@ image{
.jiuright{
width:26rpx;
height:26rpx;
font-size: 0
font-size: 0;
position: relative
}
.lj_share{
width:38rpx;
height:40rpx;
border:none;
position: absolute;
right:0rpx;
top:0rpx;
background: transparent
}
button::after{
border:none;
outline: none;
background: transparent
}
\ No newline at end of file
... ...
... ... @@ -6,7 +6,10 @@ Page({
* 页面的初始数据
*/
data: {
url:''
url:'',
id:'',
page:1,
list:[]
},
/**
... ... @@ -14,10 +17,92 @@ Page({
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url
url: app.globalData.url,
id:options.id
})
},
//获取文章列表
getarticlelist(){
let that = this;
let url = 'index/Find/article_list', params = {
category_id:that.data.id,
page:that.data.page
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
list:that.data.list.concat(res.list)
})
}).catch((err) => {
})
},
//点赞和取消点赞
dianzan(e){
let that = this;
let id=e.currentTarget.dataset.id;
let url = 'index/Common/good', params = {
sort:4,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
let newlist=that.data.list;
for(var obj of newlist){
if (obj.is_good==0){
obj.is_good=1;
obj.good_count = obj.good_count+1
}else{
obj.is_good=0;
if (obj.good_count==0){
obj.obj.good_count=0
}else{
obj.good_count = obj.good_count-1
}
}
}
that.setData({
list:newlist
})
}).catch((err) => {
})
},
//进入评论页面
ping(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/myblock/pingjia/pingjia?id='+id+'&type='+4,
})
},
//详情页面
detail(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/findblock/wenzhangdetail/wenzhangdetail?id='+id,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -29,7 +114,12 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
page:1,
list:[]
})
this.getarticlelist()
},
/**
... ... @@ -57,13 +147,42 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let page = this.data.page;
page++;
this.setData({
page: page,
})
this.getarticlelist()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function (e) {
let that = this;
let id = e.target.dataset.id;
let url = '/pages/findblock/wenzhangdetail/wenzhangdetail?id=' + id
return {
title: '发现', // 转发后 所显示的title
// path: '/pages/home/buildtextdetail/buildtextdetail?buildid='+buildid+'&gettoken='+newtoken, // 相对的路径
path: url,//建档攻略分享1
// path:'',
success: (res) => { // 成功后要做的事情
console.log(res)
},
fail: function (res) {
// 分享失败
console.log(res)
}
}
}
})
\ No newline at end of file
... ...
<view class="wineblock">
<view class="winetitle">浓香酒酿酒大师:沈才宏</view>
<view class="wineimg">
<image src="{{url}}aicon_64.png"></image>
</view>
<view class="winebottom">
<view class="winebottomleft">
<view class="winebottomleftimg">
<image src="{{url}}aicon_65x.png"></image>
</view>
<view class="wineeng">WinesBook</view>
</view>
<view class="winebottonright">
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_66x.png"></image>
</view>
<view class="winezan">18</view>
</view>
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_67x.png"></image>
</view>
<view class="winezan">54</view>
</view>
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_68x.png"></image>
</view>
</view>
</view>
</view>
</view>
<view class="wineblock">
<view class="nodata" wx:if="{{list.length==0}}" class="nodata">暂无数据</view>
<block wx:else>
<view class="wineblock" wx:for="{{list}}" wx:key='' bindtap="detail" data-id="{{item.id}}">
<view class="winetitle">浓香酒酿酒大师:沈才宏</view>
<view class="winetitle">{{item.title}}</view>
<view class="wineimg">
<image src="{{url}}aicon_64.png"></image>
<image src="{{item.thumb}}"></image>
</view>
<view class="winebottom">
<view class="winebottomleft">
<view class="winebottomleftimg">
<image src="{{url}}aicon_65x.png"></image>
<image src="{{item.avatar}}"></image>
</view>
<view class="wineeng">WinesBook</view>
<view class="wineeng">{{item.name}}</view>
</view>
<view class="winebottonright">
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_66x.png"></image>
<view class="winerighttouimg" catchtap="dianzan" data-id="{{item.id}}">
<image src="{{url}}aicon_47x.png" wx:if="{{item.is_good==0}}"></image>
<image src="{{url}}aicon_46x.png" wx:else></image>
</view>
<view class="winezan">18</view>
<view class="winezan">{{item.good_count}}</view>
</view>
<view class="winerighttou">
<view class="winerighttou" catchtap='ping' data-id="{{item.id}}">
<view class="winerighttouimg">
<image src="{{url}}aicon_67x.png"></image>
</view>
<view class="winezan">54</view>
<view class="winezan">{{item.comment_count}}</view>
</view>
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_68x.png"></image>
<button class="lj_share" catchtap="buildshare" open-type='share' data-id="{{item.id}}" ></button>
</view>
</view>
... ... @@ -79,4 +43,5 @@
</view>
</view>
\ No newline at end of file
</view>
</block>
... ...
... ... @@ -35,7 +35,8 @@
.winerighttouimg{
width:30rpx;
height:28rpx;
font-size: 0
font-size: 0;
position:relative
}
.winerighttou{
display:flex;
... ... @@ -49,7 +50,7 @@
.winezan{
color:#666666;
font-size:28rpx;
margin-left:5rpx;
margin-left:10rpx;
}
.wineblock{
border-bottom: 1rpx solid #f5f5f5;
... ... @@ -61,3 +62,29 @@
height:32rpx;
font-size: 0
}
.lj_share{
width:38rpx;
height:40rpx;
border:none;
position: absolute;
right:0rpx;
top:0rpx;
background: transparent
}
button::after{
border:none;
outline: none;
background: transparent
}
.lj_share{
width:20rpx;
height:30rpx;
border:none;
position: absolute;
right:0;
top:0;
background: transparent
}
\ No newline at end of file
... ...
// pages/homeblock/niangjiuteacher/niangjiuteacher.js
var WxParse = require('../../../wxParse/wxParse.js');
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
url: '',
id: '',
page: 1
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url,
id: options.id
})
let token=wx.getStorageSync("token");
if(token==''){
wx.navigateTo({
url: '/pages/login/login?id=' + this.data.id + '&type=' + 1,//type=1发现的首页专家品酒
})
wx.setStorageSync("url", "/pages/findblock/wenzhangdetail/wenzhangdetail")
}
},
//获取酿酒师
getniangjiu() {
let that = this;
let url = 'index/Find/article_detail', params = {
id: that.data.id,
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
info: res.info,
})
WxParse.wxParse('article', 'html', res.info.content, that, 5)
}).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
})
},
//点赞
zan(e) {
let that = this;
let id = e.currentTarget.dataset.id;
let url = 'index/Common/good', params = {
sort: 4,
id: id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon: "none"
})
let newinfo = that.data.info;
console.log(newinfo)
if (newinfo.is_good == 0) {
newinfo.is_good = 1;
newinfo.good_count = newinfo.good_count + 1
} else {
newinfo.is_good = 0;
if (newinfo.good_count == 0) {
newinfo.good_count = 0
} else {
newinfo.good_count = newinfo.good_count - 1
}
}
that.setData({
info: newinfo
})
console.log(that.data.info)
}).catch((err) => {
})
},
//评论
ping(e) {
let id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/myblock/pingjia/pingjia?id=' + id + '&type=' + 4,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getniangjiu()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let that = this;
let url = url = '/pages/findblock/wenzhangdetail/wenzhangdetail?id=' + that.data.id
return {
title: '发现', // 转发后 所显示的title
// path: '/pages/home/buildtextdetail/buildtextdetail?buildid='+buildid+'&gettoken='+newtoken, // 相对的路径
path: url,//建档攻略分享1
// path:'',
success: (res) => { // 成功后要做的事情
console.log(res)
},
fail: function (res) {
// 分享失败
console.log(res)
}
}
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<import src="../../../wxParse/wxParse.wxml" />
<view class="teacherhead">
<view class="teacherleft">
<view class="teacimg">
<image src="{{info.avatar}}"></image>
</view>
<view class="teacname">{{info.name}}</view>
<view class="teacgouimg">
<image src="{{url}}aicon_20x.png"></image>
</view>
</view>
</view>
<view class="jiubottom">
<view class="jiuleft">
<view class="jiuleftimg" catchtap="zan" data-id="{{info.id}}">
<image src="{{url}}/aicon_47x.png" wx:if="{{info.is_good==0}}"></image>
<image src="{{url}}/aicon_46x.png" wx:else></image>
</view>
<view class="jiuzan">{{info.good_count}}</view>
</view>
<view class="jiumiddle" catchtap="ping" data-id="{{info.id}}">
<view class="middleimg">
<image src="{{url}}/aicon_67x.png"></image>
</view>
<view class="tiao">{{info.comment_count}}</view>
</view>
<view class="lastimg">
<view class="jiuright">
<image src="{{url}}/aicon_68x.png"></image>
<button class="lj_share" catchtap="buildshare" open-type='share'></button>
</view>
<view class="tiao">分享</view>
</view>
</view>
<view class="wineimg">
<image src="{{info.thumb}}"></image>
</view>
<view class="niangjiubox">
<view class="brandtext">
<template is="wxParse" data="{{wxParseData:article.nodes}}" />
</view>
</view>
\ No newline at end of file
... ...
@import '../../homeblock/brandpage/brandpage.wxss';
image{
width:100%;
height:100%;
}
.teacherhead{
display:flex;
justify-content: space-between;
align-items: center;
padding: 17rpx 32rpx;
box-sizing: border-box;
border-top:1rpx solid #f5f5f5;
}
.teacherleft{
display:flex;
align-items: center;
}
.teacimg{
width:60rpx;
height:60rpx;
border-radius:50%;
}
.teacimg image{
border-radius: 50%;
}
.teacname{
color:#1A1A1A;
margin-left:30rpx;
font-size:28rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
}
.teacgouimg{
width:24rpx;
height:24rpx;
font-size: 0;
margin-left:20rpx;
}
.wineimg{
width:750rpx;
height:328rpx;
margin-top:20rpx;
}
.boxtopleft{
font-weight: bold
}
.baisinfo{
padding: 38rpx 0;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
display:flex;
align-items: center;
}
.baisinfo:last-child{
border-bottom: none;
}
.basinfoleft{
display:block;
width:114rpx;
color:#999999;
font-size: 26rpx;
}
.baisinforight{
margin-left:95rpx;
}
.brandboxitem:first-child{
padding-bottom: 0
}
.brandlsit{
color:#666666;
font-size: 26rpx;
}
.jiubottom{
display:flex;
align-items: center;
justify-content: space-between;
padding: 0rpx 78rpx;
box-sizing: border-box
}
.jiuleft{
display:flex;
align-items: center;
}
.jiumiddle{
display:flex;
align-items: center
}
.jiuleftimg{
width:30rpx;
height:28rpx;
font-size: 0
}
image{
width:100%;
height:100%;
}
.jiuzan{
color:#666666;
font-size: 28rpx;
margin-left:16rpx;
}
.middleimg{
width:29rpx;
height:27rpx;
font-size: 0
}
.tiao{
color:#666666;
font-size: 28rpx;
margin-left:16rpx;
}
.jiuright{
width:26rpx;
height:26rpx;
font-size: 0;
position: relative;
}
.lastimg{
display:flex;
align-items: center
}
.lj_share{
width:20rpx;
height:30rpx;
border:none;
position: absolute;
right:0;
top:0;
background: transparent
}
button::after{
border:none;
outline:none;
}
\ No newline at end of file
... ...
... ... @@ -6,7 +6,9 @@ Page({
* 页面的初始数据
*/
data: {
url:''
url:'',
page:1,
list:[]
},
/**
... ... @@ -16,6 +18,99 @@ Page({
this.setData({
url: app.globalData.url
})
},
//获取专家酒品列表
getjiulist(){
let that = this;
let url = 'index/Find/expert_list', params = {
page: that.data.page
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
list:that.data.list.concat(res.list)
})
}).catch((err) => {
})
},
//进入视频
entervideo(e) {
let url = e.currentTarget.dataset.url;
wx.navigateTo({
url: '/pages/homeblock/video/video?url=' + url,
})
},
//点赞
dianzan(e){
let id=e.currentTarget.dataset.id;
let that = this;
let url = 'index/Common/good', params = {
id:id,
sort:2
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
let newlist = that.data.list;
for(var obj of newlist){
if(obj.id==id){
if (obj.is_good==0){
obj.is_good=1;
obj.good_count++
}else{
obj.is_good = 0
if (obj.good_count==0){
obj.good_count=0
}else{
obj.good_count = obj.good_count-1
}
}
}
}
that.setData({
list:newlist
})
}).catch((err) => {
})
},
//进入评论页面
ping(e) {
let id = e.currentTarget.dataset.id;
let type = 2
// let winemaker_id = e.currentTarget.dataset.winemaker_id
wx.navigateTo({
url: '/pages/myblock/pingjia/pingjia?type=' + type + '&id=' + id
})
},
//专家酒品详情页
detail(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/findblock/zhuanjiapinjiudetail/zhuanjiapinjiudetail?id='+id,
})
},
/**
... ... @@ -29,7 +124,11 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
page:1,
list:[]
})
this.getjiulist()
},
/**
... ... @@ -57,13 +156,42 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let page=this.data.page;
page++;
this.setData({
page:page
})
this.getjiulist()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function (e) {
let that = this;
console.log(e)
let id = e.target.dataset.id;
console.log(id)
let url = '/pages/findblock/zhuanjiapinjiudetail/zhuanjiapinjiudetail?id=' + id
return {
title: '发现', // 转发后 所显示的title
// path: '/pages/home/buildtextdetail/buildtextdetail?buildid='+buildid+'&gettoken='+newtoken, // 相对的路径
path: url,//建档攻略分享1
// path:'',
success: (res) => { // 成功后要做的事情
console.log(res)
},
fail: function (res) {
// 分享失败
console.log(res)
}
}
}
})
\ No newline at end of file
... ...
<view class="wineblock">
<view class="winetitle">浓香酒酿酒大师:沈才宏</view>
<view class="wineimg">
<image src="{{url}}aicon_64.png"></image>
</view>
<view class="winebottom">
<view class="winebottomleft">
<view class="winebottomleftimg">
<image src="{{url}}aicon_65x.png"></image>
</view>
<view class="wineeng">WinesBook</view>
<view class="wineblock" wx:for="{{list}}" wx:key='' bindtap="detail" data-id="{{item.id}}">
<view class="winetitle">{{item.title}}</view>
<view class="wineimg" catchtap="entervideo" data-url="{{item.video}}">
<image src="{{item.video_image}}"></image>
<view class="vimg">
<image src="{{url}}/aicon_70x.png"></image>
</view>
<view class="winebottonright">
<view class="winerighttou">
... ... @@ -42,28 +37,30 @@
<view class="winebottom">
<view class="winebottomleft">
<view class="winebottomleftimg">
<image src="{{url}}aicon_65x.png"></image>
<image src="{{item.avatar}}"></image>
</view>
<view class="wineeng">WinesBook</view>
<view class="wineeng">{{item.name}}</view>
</view>
<view class="winebottonright">
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_66x.png"></image>
<view class="winerighttouimg" catchtap="dianzan" data-id="{{item.id}}">
<image src="{{url}}aicon_46x.png" wx:if="{{item.is_good==1}}"></image>
<image src="{{url}}aicon_47x.png" wx:else></image>
</view>
<view class="winezan">18</view>
<view class="winezan">{{item.good_count}}</view>
</view>
<view class="winerighttou">
<view class="winerighttou" catchtap="ping" data-id="{{item.id}}">
<view class="winerighttouimg">
<image src="{{url}}aicon_67x.png"></image>
</view>
<view class="winezan">54</view>
<view class="winezan">{{item.comment_count}}</view>
</view>
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_68x.png"></image>
<button class="lj_share" catchtap="buildshare" open-type='share' data-id="{{item.id}}" ></button>
</view>
</view>
... ... @@ -71,4 +68,4 @@
</view>
</view>
\ No newline at end of file
</view>
... ...
... ... @@ -10,15 +10,6 @@
margin:30rpx auto 0;
position: relative;
}
.video_play{
position: absolute;
top: 50%;
left: 50%;
width: 80rpx;
height: 80rpx;
transform: translate(-50%,-50%);
-webkit-transform: translate(-50%,-50%);
}
.winebottom{
display:flex;
justify-content: space-between;
... ... @@ -33,6 +24,11 @@
border-radius: 50%;
overflow: hidden;
}
.winebottomleftimg image{
width:100%;
height:100%;
border-radius: 50%;
}
.winebottomleft{
display:flex;
align-items: center
... ... @@ -46,7 +42,8 @@
.winerighttouimg{
width:30rpx;
height:28rpx;
font-size: 0
font-size: 0;
position: relative
}
.winerighttou{
display:flex;
... ... @@ -60,7 +57,7 @@
.winezan{
color:#666666;
font-size:28rpx;
margin-left:5rpx;
margin-left:10rpx;
}
.wineblock{
border-bottom: 1rpx solid #f5f5f5;
... ... @@ -73,3 +70,41 @@
height:32rpx;
font-size: 0
}
.lj_share{
width:26rpx;
height:40rpx;
border:none;
position: absolute;
right:0;
top:0;
background: transparent
}
button::after{
border:none;
outline:none;
}
.video_play{
position: absolute;
top: 50%;
left: 50%;
width: 80rpx;
height: 80rpx;
transform: translate(-50%,-50%);
-webkit-transform: translate(-50%,-50%);
}
.vimg{
width:100rpx;
height:100rpx;
font-size: 0;
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%)
}
.vimg image{
width:100%;
height:100%
}
\ No newline at end of file
... ...
... ... @@ -6,7 +6,13 @@ Page({
* 页面的初始数据
*/
data: {
url:''
url:'',
id:'',
page:1,
comment_list:[],
info:'',
show:false,
content:''
},
/**
... ... @@ -14,10 +20,158 @@ Page({
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url
url: app.globalData.url,
id:options.id
})
this.getzhuanjiadetail();
this.gettype();
let token=wx.getStorageSync("token")
if (token == '') {
wx.navigateTo({
url: '/pages/login/login?id=' + this.data.id + '&type=' + 1,//type=1发现的首页专家品酒
})
wx.setStorageSync("url", "/pages/findblock/zhuanjiapinjiudetail/zhuanjiapinjiudetail")
}
},
//获取专家酒品详情
getzhuanjiadetail(){
let that = this;
let url = 'index/Find/expert_detail', params = {
id:that.data.id,
page:that.data.page
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
info:res.info,
comment_list: that.data.comment_list.concat(res.info.comment_list)
})
console.log(that.data.info)
}).catch((err) => {
})
},
gettype(){
let that=this;
wx.getNetworkType({
success: function (res) {
console.log(res)
// 返回网络类型, 有效值:
// wifi/2g/3g/4g/unknown(Android下不常见的网络类型)/none(无网络)
var networkType = res.networkType;
console.log('23874723883924', networkType)
if (networkType !='wifi'){
that.setData({
show:true
})
}else{
that.setData({
show:false
})
}
}
})
},
//进入视频
entervideo(e) {
let url = e.currentTarget.dataset.url;
wx.navigateTo({
url: '/pages/homeblock/video/video?url=' + url,
})
},
jientervideo(e){
wx.setStorageSync('show', false)
let url = e.currentTarget.dataset.url;
wx.navigateTo({
url: '/pages/homeblock/video/video?url=' + url,
})
},
//点赞
dianzan(e){
let id=e.currentTarget.dataset.id;
let that = this;
let url = 'index/Common/good', params = {
sort:2,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
that.getzhuanjiadetail()
}).catch((err) => {
})
},
//写评论内容
entercontent(e){
this.setData({
content:e.detail.value
})
},
send(e){
let that=this;
let content=e.detail.value;
if(content==''){
wx.showToast({
title: '请输入评论内容',
})
}else{
let url = 'index/Common/comment', params = {
sort:2,
id:that.data.id,
content:that.data.content
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
that.setData({
page:1,
comment_list:[]
})
that.getzhuanjiadetail()
}).catch((err) => {
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
... ... @@ -30,7 +184,14 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
// let show = wx.getStorageSync("show");
// this.setData({
// show: show
// })
// console.log('348783490', this.data.show)
},
/**
... ... @@ -58,13 +219,35 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let page=this.data.page;
page++;
this.setData({
page:page
})
this.getzhuanjiadetail()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let that=this;
let url = '/pages/findblock/zhuanjiapinjiudetail/zhuanjiapinjiudetail?id=' + that.data.id
return {
title: '发现', // 转发后 所显示的title
// path: '/pages/home/buildtextdetail/buildtextdetail?buildid='+buildid+'&gettoken='+newtoken, // 相对的路径
path: url,//建档攻略分享1
// path:'',
success: (res) => { // 成功后要做的事情
console.log(res)
},
fail: function (res) {
// 分享失败
console.log(res)
}
}
}
})
\ No newline at end of file
... ...
<view class="detailhead">
<view class="detailhead" wx:if="{{show}}" >
<view class="liuliang">播放将消耗7.72MB流量,是否需要在WIFI环境下播放</view>
<view class="goon">继续播放</view>
<view class="goon" bindtap="jientervideo" data-url="{{info.video}}">继续播放</view>
</view>
<view class="detailhead" bindtap="entervideo" data-url="{{info.video}}" wx:else>
<image src="{{info.video_image}}"></image>
<view class="vimg">
<image src="{{url}}/aicon_70x.png"></image>
</view>
</view>
<view class="winebottom">
<view class="winebottomleft">
<view class="winebottomleftimg">
<image src="{{url}}aicon_65x.png"></image>
<image src="{{info.avatar}}"></image>
</view>
<view class="wineeng">WinesBook</view>
<view class="wineeng">{{info.name}}</view>
</view>
<view class="winebottonright">
<view class="winerighttou zantou">
<view class="winerighttouimg">
<image src="{{url}}aicon_66x.png"></image>
<view class="winerighttouimg" bindtap="dianzan" data-id="{{info.id}}">
<image src="{{url}}aicon_47x.png" wx:if="{{info.is_good==0}}"></image>
<image src="{{url}}aicon_46x.png" wx:else></image>
</view>
<view class="winezan">12</view>
<view class="winezan">{{info.good_count}}</view>
</view>
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_68x.png"></image>
<button class="lj_share" bindtap="buildshare" open-type='share' ></button>
</view>
</view>
... ... @@ -32,102 +41,26 @@
<view class="commentlist">
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
<view class="commentitem">
<view class="commentitem" wx:for="{{comment_list}}" wx:key=''>
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
<image src="{{item.avatar}}"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightname">{{item.user_nickname}}</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
<view class="righttext">{{item.content}}</view>
</view>
</view>
</view>
<view class="pingjiabottom">
<view class="pbleft">
<input placeholder='输入评论的内容' placeholder-class='enterping' />
<input placeholder='输入评论的内容' placeholder-class='enterping' bindinput="entercontent"/>
</view>
<view class="pbright">发送</view>
<view class="pbright" bindtap="send">发送</view>
</view>
\ No newline at end of file
... ...
... ... @@ -3,8 +3,22 @@
height: 483rpx;
background: #000;
overflow: hidden;
position: relative
}
.detailhead image{
width:100%;
height:100%;
}
.vimg{
width:100rpx;
height:100rpx;
font-size: 0;
position: absolute;
left:50%;
top:50%;
transform: translate(-50%,-50%)
}
.liuliang {
color: #fff;
font-size: 24rpx;
... ... @@ -37,6 +51,10 @@
width: 60rpx;
height: 60rpx;
font-size: 0;
border-radius:50%
}
.winebottomleftimg image{
border-radius:50%;
}
.winebottomleft {
... ... @@ -55,6 +73,7 @@
width: 30rpx;
height: 28rpx;
font-size: 0;
position: relative
}
.winerighttou {
... ... @@ -109,10 +128,15 @@
border-radius: 50%;
}
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
.commentleft image{
border-radius: 50%;
}
.commentright {
... ... @@ -185,3 +209,19 @@ image {
text-align: center;
line-height: 60rpx;
}
.lj_share{
width:25rpx;
height:40rpx;
border:none;
position: absolute;
right:0;
top:0;
background: transparent
}
button::after{
border:none;
outline:none;
}
\ No newline at end of file
... ...
// pages/forgetmima.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
//获取验证码
getcode() {
let that = this;
let currentTime = that.data.currentTime;
that.setData({
disable: true
})
interval = setInterval(function () {
currentTime--;
that.setData({
time: currentTime + 's后再次发送',
})
if (currentTime <= 0) {
clearInterval(interval)
that.setData({
time: '重新发送',
currentTime: 61,
disable: false
})
}
}, 1000)
var url = '/user/Profile/getCode';
var params = {
mobile: that.data.phonenum,
}
app.post(url, params).then((res) => {
console.log(res);
if (res.code) {
}
}).catch((err) => {
console.log(err)
wx.showToast({
title: err.ResultMsg,
icon: "none"
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pages/forgetmima.wxml-->
<text>pages/forgetmima.wxml</text>
... ...
/* pages/forgetmima.wxss */
\ No newline at end of file
... ...
// pages/forgetmima/forgetmima.js
let interval = null;
const app=getApp()
Page({
... ... @@ -9,7 +10,14 @@ Page({
first:true,
second:false,
url:'',
phone:''
phone:'',
forgetshow:true,
currentTime:60,
time: '60秒后再次发送',
disabled:false,
yanzhengcode:'',
newpassword:'',
dengshow:false
},
/**
... ... @@ -19,12 +27,172 @@ Page({
this.setData({
url: app.globalData.url
})
},
enterphone(e){
this.setData({
phone:e.detail.value
})
this.yanhzengphone()
},
yanhzengphone(){
let value = this.data.phone
if (value.length == 11) {
this.setData({
forgetshow: false
})
}else{
this.setData({
forgetshow: true
})
}
},
clearphone(){
console.log(342)
this.setData({
phone:''
})
},
next(){
let reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
if(!reg.test(this.data.phone)){
wx.showToast({
title: '请输入正确的手机号',
icon:'none'
})
}else{
this.setData({
first:false,
second:true
})
this.getcode()
}
},
//获取验证码
getcode() {
let that = this;
let currentTime = that.data.currentTime;
that.setData({
disabled: true
})
interval = setInterval(function () {
currentTime--;
that.setData({
time: currentTime + 's后再次发送',
})
if (currentTime <= 0) {
clearInterval(interval)
that.setData({
time: '60秒后再次发送',
currentTime: 60,
disabled: false
})
}
}, 1000)
var url = '/user/Profile/getCode';
var params = {
mobile: that.data.phone,
}
app.post(url, params).then((res) => {
console.log(res);
if (res.code) {
}
}).catch((err) => {
console.log(err)
wx.showToast({
title: err.ResultMsg,
icon: "none"
})
})
},
chongxin(){
console.log(34378478)
this.getcode();
},
yanzheng(){
if (this.data.yanzhengcode.length > 0 && this.data.newpassword.length>0){
this.setData({
dengshow:true
})
}else{
this.setData({
dengshow:false
})
}
},
shuruyanzheng(e){
this.setData({
yanzhengcode:e.detail.value
})
this.yanzheng()
},
setnewmima(e){
this.setData({
newpassword:e.detail.value
})
this.yanzheng()
},
//登陆
denglu(){
console.log(47832342789);
let that = this;
console.log(that.data.newpassword.length)
if (that.data.newpassword.length < 6 || that.data.newpassword.length>20){
wx.showToast({
title: '请输入6-20位的密码',
icon:'none'
})
}else{
let url = 'user/Profile/reset_password', params = {
mobile: that.data.phone,
verification_code: that.data.yanzhengcode,
password: that.data.newpassword
}
app.post(url, params).then((res) => {
console.log(res);
// wx.switchTab({
// url: '/pages/homapage/homepage',
// })
wx.navigateTo({
url: '/pages/login/login',
})
}).catch((err) => {
wx.showToast({
title: err.data.msg,
icon: "none"
})
})
}
},
/**
... ...
... ... @@ -9,16 +9,17 @@
<view class="yanzhengmiddle">
<input placeholder='请输入手机号' placeholder-class='enterphone' bindinput="enterphone" type="number"/>
<input placeholder='请输入手机号' placeholder-class='enterphone' bindinput="enterphone" type="number" value="{{phone}}"/>
</view>
<view class="chaimg">
<view class="chaimg" bindtap="clearphone">
<image src="{{url}}/aicon_07x.png"></image>
</view>
</view>
<view class="safe">为了安全,我们会向您的手机发送验证码</view>
<view class="login">下一步</view>
<view class="login" wx:if="{{forgetshow}}">下一步</view>
<view class="login nextlogin" bindtap="next" wx:else>下一步</view>
</view>
... ... @@ -30,16 +31,17 @@
<view class="yanzhengmiddle">
<input placeholder='请输入验证码' placeholder-class='enterphone' />
<input placeholder='请输入验证码' placeholder-class='enterphone' value="{{yanzhengcode}}" bindinput="shuruyanzheng"/>
</view>
<view class="fasong">重新发送52</view>
<view class="fasong" wx:if="{{disabled==true}}">{{time}}</view>
<view class="fasong" wx:else bindtap="chongxin">重新发送</view>
</view>
<view class="yanzheng mima">
<view class="yanzhengmiddle yanzhengma">
<input placeholder='设置新密码' placeholder-class='enterphone' />
<input placeholder='设置新密码' placeholder-class='enterphone' bindinput="setnewmima" type="password" value="{{newpassword}}"/>
</view>
<view class="mimaimg">
... ... @@ -54,6 +56,8 @@
<view class="login">登录</view>
<view class="login" wx:if="{{dengshow==false}}">登录</view>
<view class="login newlogin" wx:else bindtap="denglu">登录</view>
</view>
... ...
... ... @@ -53,7 +53,7 @@ page {
.yanzhengmiddle {
width: 285rpx;
width: 257rpx;
color: #999;
font-size: 30rpx;
border-right:1rpx solid #f5f5f5;
... ... @@ -99,6 +99,12 @@ page {
font-size: 30rpx;
margin: 74rpx auto 0;
}
.newlogin{
background: #E81825
}
.nextlogin{
background: #E81825
}
.firlogin {
color: #999;
... ... @@ -124,7 +130,9 @@ page {
align-items: center
}
.yanzhengma {
width:395rpx;
margin-left: 0;
border-right:none;
}
.eyeimg{
width:34rpx;
... ...
... ... @@ -180,8 +180,15 @@ Page({
})
console.log(this.data.url)
this.getshailist();
this.gethomeindex();
this.getcity()
this.getcity();
let token=wx.getStorageSync("token");
console.log(token);
if(token==''){
wx.navigateTo({
url: '/pages/login/login',
})
}
},
//进入搜索页
... ... @@ -199,6 +206,34 @@ Page({
})
},
//扫码
saoma(){
let that = this;
wx.scanCode({
success(res) {
console.log(res)
let number = res.result;
console.log(number)
let url = 'index/Index/scan', params = {
number: number
}
app.post(url, params).then((res) => {
console.log(res);
wx.navigateTo({
url: '/pages/homeblock/jiuzidian/jiuzidian?id=' + res.info.id,
})
}).catch((err) => {
})
}
})
},
//获取用户当前位置
getcity() {
... ... @@ -210,12 +245,7 @@ Page({
var latitude = res.latitude
var longitude = res.longitude
// that.setData({
// wd: latitude,
// jd: longitude
// })
// that.gethostipallist()
var aK = that.data.aK
wx.request({
url: 'https://api.map.baidu.com/geocoder/v2/?ak=y8jPDTMIuAnaVscUztce1RKfNx8v5sok&location=' + latitude + ',' + longitude + '&output=json',
... ... @@ -226,23 +256,15 @@ Page({
success: function (res) {
console.log('1234567890', res)
var province = res.data.result.addressComponent.province;
let district = res.data.result.addressComponent.district
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,
// })
// },
})
wx.setStorageSync('cityname', '')
// wx.request({
// })
}
})
... ... @@ -496,7 +518,7 @@ Page({
//筛选首页内容
gethomeindex() {
let that = this;
var url = "/index/Index/index"
var url = "index/Index/index"
var params = {
sort_id: that.data.sort_id,
country: that.data.country,
... ... @@ -679,6 +701,8 @@ Page({
currentCity: city
})
}
this.gethomeindex();
// this.getshailist()
},
... ... @@ -714,6 +738,9 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
... ... @@ -81,7 +81,7 @@
<input placeholder='已收录298653款酒品' placeholder-class='seachenter' value="{{record}}" />
</view>
<view class="saoma">
<view class="saoma" catchtap="saoma">
<image src="{{url}}bicon_04@2x.png"></image>
</view>
</view>
... ... @@ -135,7 +135,7 @@
<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>
<image src="{{item.logo}}" mode='aspectFit'></image>
</view>
<view class="contentright">
<view class="contenttop">{{item.name}}</view>
... ... @@ -156,13 +156,13 @@
<view class='city_list_box'>
<block wx:for='{{citylist}}' wx:key='this' wx:for-item='letterItem' wx:for-index='letterIndex'>
<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='city_name' wx:for='{{letterItem.list}}' id='{{letterItem.name}}' wx:key='this' data-types='list' bindtap="jumpbrand" data-id="{{item.id}}" data-index='{{index}}' data-val='{{item}}'>
<view class="imgleft">
<image src="{{item.logo}}"></image>
<image src="{{item.logo}}" mode="aspectFit"></image>
</view>
<view class="contentright">
<view class="contenttop">{{item.name}}</view>
... ...
... ... @@ -186,7 +186,8 @@ page{
left:0;
/* transform: translate(-50%,-50%); */
display:flex;
flex-wrap: wrap
flex-wrap: wrap;
padding-bottom:15rpx;
}
.selcounitem{
... ... @@ -202,7 +203,9 @@ page{
padding: 21rpx;
box-sizing: border-box;
margin-left:20rpx;
line-height: 1
line-height: 1;
border:1rpx solid #f5f5f5;
margin-top:15rpx;
}
.imgleft{
... ... @@ -323,7 +326,8 @@ page{
border-right:none;
}
.selact{
color:#E81825
background:#E81825;
color:#fff;
}
.countryitem{
... ... @@ -336,7 +340,6 @@ page{
height:40rpx;
font-size: 0
}
.nodata{
color:#999;
font-size:30rpx;
... ...
// pages/homeblock/bofangexample/bofangexample.js
Page({
/**
* 页面的初始数据
*/
data: {
url:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
let url=wx.getStorageSync("quanurl")
this.setData({
url: url
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": ""
}
\ No newline at end of file
... ...
<view class="page-section page-section-gap">
<web-view src="{{url}}"></web-view>
</view>
\ No newline at end of file
... ...
/* pages/homeblock/bofangexample/bofangexample.wxss */
\ No newline at end of file
... ...
... ... @@ -50,22 +50,4 @@
</block>
</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>
\ No newline at end of file
... ...
... ... @@ -98,6 +98,7 @@ image{
color:#1A1A1A;
font-size: 26rpx;
margin-top:28rpx;
padding: 0 30rpx;
}
.brandimg{
width:686rpx;
... ...
... ... @@ -9,7 +9,9 @@ Page({
url: '',
id: "",
picture:[],
banner:[]
banner:[],
arrbanner: [],
arrpicture: []
},
/**
... ... @@ -37,6 +39,23 @@ Page({
banner:res.banner,
picture: res.picture
})
let bannerarr=[];
let picturearr=[]
let newbanner=that.data.banner;
let newpicture = that.data.picture
for(var obj of newbanner){
bannerarr.push(obj.url)
}
for (var obj of newpicture){
picturearr.push(obj.url)
}
that.setData({
arrbanner: bannerarr,
arrpicture: picturearr
})
... ... @@ -44,6 +63,35 @@ Page({
})
},
//图片预览标准图
viewImg(e) {
let that = this;
let index = e.currentTarget.dataset.index;
wx.previewImage({
current: that.data.banner[index].url,
urls: that.data.arrbanner,
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
},
//图片预览写真图
viewImg1(e) {
let that = this;
let index = e.currentTarget.dataset.index;
wx.previewImage({
current: that.data.picture[index].url,
urls: that.data.arrpicture,
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -3,7 +3,7 @@
</view>
<view class="biaozhaunbox">
<view class="biaozhuanitem" wx:for="{{banner}}" wx:key="">
<view class="biaozhuanitem" wx:for="{{banner}}" wx:key="" bindtap='viewImg' data-index="{{index}}">
<image src="{{item.url}}"></image>
</view>
... ... @@ -16,7 +16,7 @@
</view>
<view class="biaozhaunbox">
<view class="biaozhuanitem" wx:for="{{picture}}" wx:key=''>
<view class="biaozhuanitem" wx:for="{{picture}}" wx:key='' bindtap='viewImg1' data-index="{{index}}">
<image src="{{item.url}}"></image>
</view>
... ...
... ... @@ -25,7 +25,10 @@ Page({
jiushishow:true,
othercontent:[],
qiyearr:[],
score:''
score:'',
panorama:[],
imglogo:'',
videoimg:''
},
... ... @@ -33,6 +36,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
url: app.globalData.url,
id:options.id,
... ... @@ -40,7 +44,15 @@ Page({
})
this.getwinedetail()
this.getwinedetail();
let token=wx.getStorageSync("token");
if(token==''){
wx.navigateTo({
url: '/pages/login/login?id=' + this.data.id+'&type=' +2,//type=2酒字典详情页
})
wx.setStorageSync("url", "/pages/homeblock/jiuzidian/jiuzidian")
}
},
//获取酒品详情
getwinedetail(){
... ... @@ -54,10 +66,15 @@ Page({
that.setData({
wineinfo:res,
navarr: res.wine_attr,
score: res.score*10
score: res.score*10,
panorama: res.panorama,
imglogo: res.panorama[0].product_thumbnail,
videoimg: res.panorama[0].product_url,
})
console.log(that.data.score)
wx.setStorageSync("quanurl", res.panorama[0].product_url)
let newnavarr = that.data.navarr;
for (var obj of newnavarr){
... ... @@ -223,6 +240,36 @@ Page({
this.setData({
kind:e.currentTarget.dataset.kind
})
let kind = e.currentTarget.dataset.kind;
if(kind==0){
this.setData({
imglogo: this.data.panorama[0].product_thumbnail,
videoimg: this.data.panorama[0].product_url
})
wx.setStorageSync("quanurl", this.data.panorama[0].product_url)
}else if(kind==1){
this.setData({
imglogo: this.data.panorama[1].product_thumbnail,
videoimg: this.data.panorama[1].product_url
})
wx.setStorageSync("quanurl", this.data.panorama[1].product_url)
}else {
this.setData({
imglogo: this.data.panorama[2].product_thumbnail,
videoimg: this.data.panorama[2].product_url
})
wx.setStorageSync("quanurl", this.data.panorama[2].product_url)
}
},
entervideo(e){
console.log(e)
let url=e.currentTarget.dataset.url;
wx.setStorageSync('quanurl', url)
wx.navigateTo({
url: '/pages/homeblock/bofangexample/bofangexample',
})
},
select(e) {
console.log(e)
... ... @@ -250,6 +297,10 @@ Page({
wx.navigateTo({
url: '/pages/homeblock/shortvideo/shortvideo?wineid='+this.data.id,
})
}else if(pic==0){
wx.navigateTo({
url: '/pages/homeblock/bofangexample/bofangexample',
})
}
... ... @@ -357,6 +408,23 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let that = this;
let url = '/pages/homeblock/jiuzidian/jiuzidian?id=' + that.data.id
return {
title: '发现', // 转发后 所显示的title
// path: '/pages/home/buildtextdetail/buildtextdetail?buildid='+buildid+'&gettoken='+newtoken, // 相对的路径
path: url,//建档攻略分享1
// path:'',
success: (res) => { // 成功后要做的事情
console.log(res)
},
fail: function (res) {
// 分享失败
console.log(res)
}
}
}
})
\ No newline at end of file
... ...
<import src="../../../wxParse/wxParse.wxml" />
<!-- 展示图 -->
<view class="showpic">
<image src="{{wineinfo.logo}}"></image>
<image src="{{imglogo}}" mode="aspectFit" data-url="{{videoimg}}" bindtap="entervideo"></image>
<!-- <view class="heig">
<view class="page-section page-section-gap">
<web-view src="https://www.othkin.com/3DExp/ShowH5.html?eleblacklist=MoreButton&gyro=1&id=65f0221f710c8ffca254e93ce7e37741"></web-view>
</view>
</view> -->
<view class="kindlist">
<view class="kinditem {{kind==0?'kindactive':''}}" data-kind='0' bindtap="selectkind">瓶</view>
... ...
... ... @@ -53,7 +53,8 @@ page{
width:750rpx;
height:560rpx;
font-size: 0;
position: relative
position: relative;
background: #fff;
}
.kindlist{
width:198rpx;
... ... @@ -167,4 +168,13 @@ page{
bottom:81rpx;
right:56rpx;
}
.page-section{
height:100rpx;
}
.section web-view {
height:100rpx;
}
.heig{
height:100rpx;
}
\ No newline at end of file
... ...
// pages/homeblock/niangjiuteacher/niangjiuteacher.js
var WxParse = require('../../../wxParse/wxParse.js');
const app=getApp()
Page({
... ... @@ -6,7 +7,9 @@ Page({
* 页面的初始数据
*/
data: {
url:''
url:'',
id:'',
page:1
},
/**
... ... @@ -14,10 +17,157 @@ Page({
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url
url: app.globalData.url,
id:options.id
})
let token=wx.getStorageSync("token");
if(token==''){
wx.navigateTo({
url: '/pages/login/login?id=' + this.data.id + '&type=' + 1,//type=1发现的首页酿酒师
})
wx.setStorageSync("url", "/pages/homeblock/niangjiuteacher/niangjiuteacher")
}
},
//获取酿酒师
getniangjiu(){
let that = this;
let url = 'index/Winemaker/detail', params = {
id:that.data.id,
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
info:res,
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:2,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
let newinfo=that.data.info;
if (newinfo.is_concern==0){
newinfo.is_concern=1
}else{
newinfo.is_concern = 0
}
that.setData({
info:newinfo
})
}).catch((err) => {
})
},
//点赞
zan(e){
let that = this;
let id=e.currentTarget.dataset.id;
let url = 'index/Common/good', params = {
sort:3,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:"none"
})
let newinfo = that.data.info;
console.log(newinfo)
if (newinfo.is_good == 0) {
newinfo.is_good = 1;
newinfo.good_count = newinfo.good_count+1
} else {
newinfo.is_good = 0;
if (newinfo.good_count==0){
newinfo.good_count=0
}else{
newinfo.good_count = newinfo.good_count-1
}
}
that.setData({
info: newinfo
})
console.log(that.data.info)
}).catch((err) => {
})
},
//评论
ping(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/myblock/pingjia/pingjia?winemaker_id='+id+'&type='+3,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -29,7 +179,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getniangjiu()
},
/**
... ... @@ -64,6 +214,23 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let that = this;
let url = '/pages/homeblock/niangjiuteacher/niangjiuteacher?id='+ that.data.id
return {
title: '发现', // 转发后 所显示的title
// path: '/pages/home/buildtextdetail/buildtextdetail?buildid='+buildid+'&gettoken='+newtoken, // 相对的路径
path: url,//建档攻略分享1
// path:'',
success: (res) => { // 成功后要做的事情
console.log(res)
},
fail: function (res) {
// 分享失败
console.log(res)
}
}
}
})
\ No newline at end of file
... ...
<import src="../../../wxParse/wxParse.wxml" />
<view class="teacherhead">
<view class="teacherleft">
<view class="teacimg">
<image src="{{url}}aicon_77@2x.png"></image>
<image src="{{info.avatar}}"></image>
</view>
<view class="teacname">徐强</view>
<view class="teacname">{{info.name}}</view>
<view class="teacgouimg">
<image src="{{url}}aicon_20x.png"></image>
</view>
</view>
<view class="atten">
<view class="atten" bindtap="attention" data-id="{{info.id}}" wx:if="{{info.is_concern==0}}">
关注
</view>
<view class="atten" bindtap="attention" data-id="{{info.id}}" wx:else>
取消关注
</view>
</view>
<view class="jiubottom">
<view class="jiuleft">
<view class="jiuleftimg" catchtap="zan" data-id="{{info.id}}">
<image src="{{url}}/aicon_47x.png" wx:if="{{info.is_good==0}}"></image>
<image src="{{url}}/aicon_46x.png" wx:else></image>
</view>
<view class="jiuzan">{{info.good_count}}</view>
</view>
<view class="jiumiddle" catchtap="ping" data-id="{{info.id}}">
<view class="middleimg">
<image src="{{url}}/aicon_67x.png"></image>
</view>
<view class="tiao">{{info.comment_count}}</view>
</view>
<view class="lastimg">
<view class="jiuright">
<image src="{{url}}/aicon_68x.png"></image>
<button class="lj_share" catchtap="buildshare" open-type='share'></button>
</view>
<view class="tiao">分享</view>
</view>
</view>
<view class="wineimg">
<image src="{{url}}aicon_91x.png"></image>
<image src="{{info.thumb}}"></image>
</view>
<view class="niangjiubox">
<view class="brandboxitem">
<!-- <view class="brandboxitem">
<view class="boxtop">
<view class="boxtopleft">
基本信息
... ... @@ -47,30 +81,24 @@
</view>
</view>
<view class="brandboxitem">
</view> -->
<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">
<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==true}}">
<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>
... ... @@ -80,7 +108,7 @@
</view>
<view class="brandboxitem">
<!-- <view class="brandboxitem">
<view class="boxtop">
<view class="boxtopleft">
代表作品
... ... @@ -110,6 +138,6 @@
</view>
</view>
</view> -->
</view>
\ No newline at end of file
... ...
... ... @@ -43,6 +43,7 @@ image{
.wineimg{
width:750rpx;
height:328rpx;
margin-top:20rpx;
}
.boxtopleft{
font-weight: bold
... ... @@ -74,4 +75,68 @@ image{
color:#666666;
font-size: 26rpx;
}
.jiubottom{
display:flex;
align-items: center;
justify-content: space-between;
padding: 0rpx 78rpx;
box-sizing: border-box
}
.jiuleft{
display:flex;
align-items: center;
}
.jiumiddle{
display:flex;
align-items: center
}
.jiuleftimg{
width:30rpx;
height:28rpx;
font-size: 0
}
image{
width:100%;
height:100%;
}
.jiuzan{
color:#666666;
font-size: 28rpx;
margin-left:16rpx;
}
.middleimg{
width:29rpx;
height:27rpx;
font-size: 0
}
.tiao{
color:#666666;
font-size: 28rpx;
margin-left:16rpx;
}
.jiuright{
width:26rpx;
height:26rpx;
font-size: 0;
position: relative
}
.lastimg{
display:flex;
align-items: center
}
.lj_share{
width:20rpx;
height:30rpx;
border:none;
position: absolute;
right:0;
top:0;
background: transparent
}
button::after{
border:none;
outline:none;
}
\ No newline at end of file
... ...
... ... @@ -134,7 +134,20 @@ Page({
icon:'none'
})
that.getlist()
let newsearchlistarr = that.data.searchlistarr;
for (var obj of newsearchlistarr){
if(obj.id==id){
if (obj.is_favorite==0){
obj.is_favorite=1
}else{
obj.is_favorite=0
}
}
}
that.setData({
searchlistarr:newsearchlistarr
})
... ... @@ -158,7 +171,20 @@ Page({
icon: 'none'
})
that.getlist()
let newsearchlistarr = that.data.searchlistarr;
for (var obj of newsearchlistarr) {
if (obj.id == id) {
if (obj.is_concern == 0) {
obj.is_concern = 1
} else {
obj.is_concern = 0
}
}
}
that.setData({
searchlistarr: newsearchlistarr
})
... ... @@ -218,9 +244,16 @@ Page({
//跳页
jumpbrand(e){
let id=e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/homeblock/brandlist/brandlist?id='+id,
})
if(this.data.select==1){
wx.navigateTo({
url: '/pages/homeblock/jiuzidian/jiuzidian?id=' + id,
})
}else if(this.data.select==2){
wx.navigateTo({
url: '/pages/homeblock/brandlist/brandlist?id=' + id,
})
}
},
//酒企
jumpcompany(e){
... ... @@ -229,6 +262,18 @@ Page({
url: '/pages/homeblock/companyintro/companyintro?id=' + id,
})
},
enterjiuqi(e){
let id=e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/homeblock/companyintro/companyintro?id=' + id,
})
},
enterpinpai(e){
let id=e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/homeblock/brandlist/brandlist?id=' + id,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -46,7 +46,10 @@
<view class="textbox">
<view class="seahead">
<view class="searword" wx:for="{{list}}" wx:key="" bindtap="enterwine" data-id="{{item.id}}">{{item.name}}</view>
<view class="searword" wx:for="{{list}}" wx:key="" bindtap="enterwine" data-id="{{item.id}}" wx:if="{{select==1}}">{{item.name}}</view>
<view class="searword" wx:for="{{list}}" wx:key="" bindtap="enterpinpai" data-id="{{item.id}}" wx:if="{{select==2}}">{{item.name}}</view>
<view class="searword" wx:for="{{list}}" wx:key="" bindtap="enterjiuqi" data-id="{{item.id}}" wx:if="{{select==3}}">{{item.name}}</view>
</view>
... ... @@ -72,7 +75,9 @@
</view>
<view class="seahead">
<view class="searword" wx:for="{{favorite}}" wx:key=''>{{item.name}}</view>
<view class="searword" wx:for="{{favorite}}" wx:key='' wx:key="" bindtap="enterwine" data-id="{{item.id}}" wx:if="{{select==1}}">{{item.name}}</view>
<view class="searword" wx:for="{{favorite}}" wx:key='' wx:key="" bindtap="enterpinpai" data-id="{{item.id}}" wx:if="{{select==2}}">{{item.name}}</view>
<view class="searword" wx:for="{{favorite}}" wx:key='' wx:key="" bindtap="enterjiuqi" data-id="{{item.id}}" wx:if="{{select==3}}">{{item.name}}</view>
</view>
... ...
... ... @@ -191,4 +191,10 @@ image{
text-align: center;
line-height: 50rpx;
}
.nodata{
color:#999;
font-size: 30rpx;
text-align: center;
margin-top:30rpx;
}
\ No newline at end of file
... ...
... ... @@ -9,7 +9,8 @@ Page({
data: {
url:"",
id:'',
shipaiarr:[]
shipaiarr:[],
shiarr:[]
},
/**
... ... @@ -24,6 +25,20 @@ Page({
this.getshipai()
},
//图片预览
viewImg(e) {
let that=this;
let index = e.currentTarget.dataset.index;
wx.previewImage({
current: that.data.shipaiarr[index].url,
urls: that.data.shiarr,
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
},
//获取官图
getshipai(){
let that = this;
... ... @@ -37,6 +52,14 @@ Page({
that.setData({
shipaiarr:res.list
})
let newarr=[];
let newshipaiarr = that.data.shipaiarr;
for (var obj of newshipaiarr){
newarr.push(obj.url)
}
that.setData({
shiarr: newarr
})
}).catch((err) => {
... ...
<view class="containerbox">
<view class="boxitem" wx:for="{{shipaiarr}}" wx:key=''>
<view class="itemimg">
<view class="boxitem" wx:for="{{shipaiarr}}" wx:key='' >
<view class="itemimg" bindtap='viewImg' data-index="{{index}}">
<image src="{{item.url}}"></image>
</view>
... ...
... ... @@ -42,6 +42,7 @@ Page({
current: 0,
zhinengwrap: false,
citychose: false,
pricechose:false,
use_id: '',
odor_id: '',
package_id: '',
... ... @@ -52,7 +53,9 @@ Page({
type: '',
zhinengarr: [],
zhinenglist: [],
page:1
page:1,
priceyuan:'0元',
pricevalue:0
},
/**
... ... @@ -66,7 +69,6 @@ Page({
this.getshaicontent()
this.getmorenconetent();
},
... ... @@ -92,30 +94,54 @@ Page({
console.log(999)
this.setData({
citychose: true,
zhinengwrap: false
zhinengwrap: false,
pricechose: false
})
} else {
this.setData({
citychose: false,
zhinengwrap: false,
pricechose: false
})
}
}else if(type==2){
if (newnavarr[i].sel == true) {
console.log(999)
this.setData({
citychose: false,
zhinengwrap: false,
pricechose:true
})
} else {
this.setData({
citychose: false,
zhinengwrap: false
zhinengwrap: false,
pricechose:false
})
}
} else {
}else {
if (newnavarr[i].sel == true) {
console.log(999)
this.setData({
citychose: false,
zhinengwrap: true
zhinengwrap: true,
pricechose: false
})
} else {
this.setData({
citychose: false,
zhinengwrap: false
zhinengwrap: false,
pricechose: false
})
}
... ... @@ -124,8 +150,6 @@ Page({
} else {
newnavarr[i].sel = false
}
}
... ... @@ -484,11 +508,12 @@ Page({
//获取默认数据
getmorenconetent() {
let that = this;
console.log(that.data.pricevalues)
let url = 'index/Filter/index',
params = {
use_id: that.data.use_id,
odor_id: that.data.odor_id,
pce:that.data.price,
price: that.data.pricevalues,
package_id: that.data.package_id,
city: that.data.city,
score: that.data.score,
... ... @@ -533,7 +558,29 @@ Page({
})
},
changing(e){
console.log(e);
this.setData({
priceyuan:e.detail.value+'元',
pricevalue:e.detail.value
})
},
hideprice(){
this.setData({
pricechose:false
})
let newnavarr = this.data.navarr;
for (var obj of newnavarr) {
obj.sel = false
}
newnavarr[1].name =this.data.priceyuan
this.setData({
navarr: newnavarr
})
this.getmorenconetent()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -23,6 +23,21 @@
</view>
</view>
<!-- 价格 -->
<view class="register" wx:if="{{pricechose}}" bindtap="hideprice">
<view class="registerwrap">
<view class="section section_gap">
<view class="pyuan">{{priceyuan}}</view>
<view class="body-view">
<slider bindchange="slider2change" step="5" backgroundColor="#f5f5f5" activeColor="red" block-size="8" step="1" bindchanging="changing" value="{{pricevalue}}" max="{{zhinengarr[0].max}}" min="{{zhinengarr[0].min}}"/>
</view>
</view>
</view>
</view>
<view class="shaisel">
<view class="kind">
... ... @@ -42,34 +57,34 @@
<view class="zhinengbox">
<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="{{item.logo}}"></image>
</view>
<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="{{item.logo}}"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">{{item.name}}</view>
<view class="nambottom">
<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 class="itemiddle">
<view class="itemidelename">{{item.name}}</view>
<view class="nambottom">
<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>
<view class="starimg" bindtap="collect" data-id="{{item.id}}">
<view class="starimg" bindtap="collect" data-id="{{item.id}}">
<image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
<image src="{{url}}aicon_09x.png" wx:else></image>
</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>
</block>
</view>
</block>
</view>
\ No newline at end of file
... ...
... ... @@ -137,3 +137,11 @@ page {
height: 40rpx;
font-size: 0;
}
.section{
width:100%;
}
.pyuan{
color:#E81825;
font-size: 28rpx;
margin:20rpx 0 0 20rpx;
}
\ No newline at end of file
... ...
... ... @@ -11,8 +11,10 @@ Page({
url:'',
phonenum:'',
currentTime: 60,
mimaphone:'18902082533',
mima:'qqqqqq'
mimaphone:'',
mima:'',
type:'',
id:''
},
/**
... ... @@ -20,7 +22,9 @@ Page({
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url
url: app.globalData.url,
type:options.type,
id:options.id
})
},
yanzheng(){
... ... @@ -41,8 +45,10 @@ Page({
},
//清空手机号
clearphone(){
console.log(43823489)
this.setData({
phonenum:''
phonenum:'',
phone:''
})
},
... ... @@ -69,7 +75,7 @@ Page({
} else {
wx.navigateTo({
url: '/pages/enteryanzheng/enteryanzheng?phonenum='+that.data.phonenum,
url: '/pages/enteryanzheng/enteryanzheng?phonenum='+that.data.phonenum+'&type='+that.data.type+'&id='+that.data.id,
})
... ... @@ -128,9 +134,31 @@ Page({
app.post(url, params).then((res) => {
console.log(res);
wx.setStorageSync('token', res.token)
wx.switchTab({
url: '/pages/homapage/homepage',
})
if (res.is_update==0){
wx.navigateTo({
url: '/pages/peopleinfo/peopleinfo',
})
}else{
//type=1 发现首页的分享
if(that.data.type==1){
let url=wx.getStorageSync("url")
wx.navigateTo({
url: url+'?id='+that.data.id
})
} else if (that.data.type == 2){
let url = wx.getStorageSync("url")
wx.navigateTo({
url: url + '?id=' + that.data.id
})
}else{
wx.switchTab({
url: '/pages/homapage/homepage',
})
}
}
}).catch((err) => {
console.log(err)
wx.showToast({
... ... @@ -147,7 +175,16 @@ Page({
url: '/pages/forgetmima/forgetmima',
})
},
clearphone(){
this.setData({
mimaphone:''
})
},
clearmima(){
this.setData({
mima:''
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -24,9 +24,10 @@
<view class="chaimg" bindtap="clearphone">
<image src="{{url}}/aicon_07x.png"></image>
</view>
</view>
</view>
<view class="login" bindtap="login">登录</view>
<view class="firlogin">首次登录会自动创建新账号</view>
</view>
... ... @@ -47,7 +48,7 @@
<input placeholder='请输入手机号' placeholder-class='enterphone' value="{{mimaphone}}" type="number" bindinput="mimaphone" />
</view>
<view class="chaimg">
<view class="chaimg" bindtap="clearphone">
<image src="{{url}}/aicon_07x.png"></image>
</view>
</view>
... ... @@ -56,7 +57,7 @@
<input placeholder='请输入密码' placeholder-class='enterphone' bindinput="shumima" type="password" value="{{mima}}"/>
</view>
<view class="mimaimg">
<view class="mimaimg" bindtap="clearmima">
<view class="chaimg">
<image src="{{url}}/aicon_07x.png"></image>
</view>
... ...
... ... @@ -19,6 +19,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
url: app.globalData.url
})
... ...
... ... @@ -6,9 +6,13 @@ Page({
* 页面的初始数据
*/
data: {
region: ['广东省', '广州市', '海珠区'],
region: ['北京', '北京市', '东城区'],
url:'',
sex:1
sex:1,
imglogol:'',
chuantouxiang:'',
user_nickname:''
},
/**
... ... @@ -23,6 +27,7 @@ Page({
this.setData({
sex:e.currentTarget.dataset.sex
})
},
bindRegionChange: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
... ... @@ -30,6 +35,81 @@ Page({
region: e.detail.value
})
},
//输入昵称
enterusername(e){
this.setData({
user_nickname:e.detail.value
})
},
//添加图片
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)
that.setData({
chuantouxiang: res.local_url,
imglogol:res.url
})
// 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) { }
})
},
//修改个人信息
changeinfo(){
let that = this;
let url = 'user/Center/set_userinfo', params = {
avatar: that.data.chuantouxiang,
region:that.data.region,
user_nickname:that.data.user_nickname,
sex:that.data.sex
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: '修改成功',
icon:'none'
})
setTimeout(function(){
wx.switchTab({
url: '/pages/homapage/homepage',
})
},1500)
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
<view class="upimg">
<image src="/"></image>
<view class="upimg" bindtap="chooseImage">
<image src="{{imglogol}}" wx:if="{{imglogol!=''}}"></image>
<image src="/img/cc.png" wx:else></image>
</view>
<view class="enternicheng">
<input placeholder='请输入昵称' placeholder-class='shuruni' />
<input placeholder='请输入昵称' placeholder-class='shuruni' bindinput="enterusername"/>
</view>
<view class="sleectrigion ">
... ... @@ -28,4 +30,4 @@
<view class="sexoption {{sex==2?'sexactive':''}}" data-sex="2" bindtap='sexselect'>女</view>
</view>
<view class="save">保存</view>
\ No newline at end of file
<view class="save" bindtap="changeinfo">保存</view>
\ No newline at end of file
... ...
... ... @@ -6,11 +6,13 @@ page {
width: 160rpx;
height: 160rpx;
border-radius: 50%;
font-size: 0;
margin:90rpx auto 0;
}
.upimg image {
border-radius: 50%;
margin: 90rpx auto 0;
}
.enternicheng {
... ... @@ -85,6 +87,7 @@ page {
color: #1a1a1a;
text-align: center;
line-height: 100rpx;
border:1rpx solid transparent
}
.save {
... ...
// pages/setmima/setmima.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
url:'',
password:'',
currentTime: 60,
time: '',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url
})
},
shezhimima(e){
this.setData({
password: e.detail.value
})
},
queding(){
let that = this;
let value=that.data.password;
if (value.length < 6 || value.length > 20) {
wx.showToast({
title: '请输入6-20位的密码',
icon: 'none'
})
} else {
let url = 'user/Profile/set_password', params = {
password:value
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: '设置密码成功',
icon:"none"
})
setTimeout(function(){
wx.switchTab({
url: '/pages/homapage/homepage',
})
},1500)
}).catch((err) => {
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "设置密码"
}
\ No newline at end of file
... ...
<view class="shemima">设置密码后你可以用手机号和密码登录</view>
<view class="setmima">
<view class="setmimaleft">
<input placeholder='设置密码' placeholder-class='shemi' bindinput="shezhimima" type="password"/>
</view>
<view class="mimaeye">
<image src="{{url}}/bicon_14x.png"></image>
</view>
</view>
<view class="que" bindtap="queding">确认</view>
<view class="needmi">需要有6-20位数字、字母或符号组成,至少两种</view>
<!--
<view class="mimasuccess">密码设置成功</view> -->
... ...
page{
background: #F2F2F2
}
.setmima{
width:540rpx;
height:120rpx;
background:rgba(255,255,255,1);
border-radius:5rpx;
margin:74rpx auto 0;
display:flex;
align-items: center;
justify-content: space-between;
padding: 0 30rpx;
box-sizing: border-box
}
.setmimaleft{
width:420rpx;
color:#1A1A1A;
font-size: 30rpx;
}
.shemi{
color:#1A1A1A;
font-size: 30rpx;
}
.mimaeye{
width:34rpx;
height:16rpx;
font-size: 0
}
.que{
width:540rpx;
height:100rpx;
background:rgba(232,24,37,1);
border-radius:50rpx;
color:#fff;
font-size: 30rpx;
text-align: center;
line-height: 100rpx;
margin:90rpx auto 0;
}
.needmi{
color:#999999;
font-size: 24rpx;
text-align: center;
margin-top:32rpx;
}
.mimasuccess{
width:290rpx;
height:60rpx;
background:rgba(0,0,0,1);
opacity:0.8;
border-radius:10rpx;
color:#fff;
font-size: 24rpx;
text-align: center;
line-height: 60rpx;
margin:468rpx auto 0;
}
.shemima{
color:#1A1A1A;
font-size: 28rpx;
font-weight: bold;
text-align: center;
margin-top: 106rpx;
}
\ No newline at end of file
... ...
... ... @@ -315,6 +315,7 @@
"name": "个人中心收藏品牌",
"pathName": "pages/myblock/pinpai/pinpai",
"query": "",
"query": "",
"scene": null
},
{
... ...