Browse Source

cy首页4

zys
kk_888 3 years ago
parent
commit
a5a5716139
  1. 2
      api/http.js
  2. 5
      app.json
  3. 28
      pages/courseDetail/index.js
  4. 11
      pages/courseDetail/index.wxml
  5. 4
      pages/courseDetail/index.wxss
  6. 2
      pages/goodsList/index.js
  7. 11
      pages/goodsList/index.wxml
  8. 11
      pages/home/index.js
  9. 4
      pages/home/index.wxml
  10. 23
      project.private.config.json

2
api/http.js

@ -1,4 +1,4 @@
const baseURL = 'http://192.168.0.112:8088/api/'; const baseURL = 'http://192.168.0.111:8088/api/';
export function $http(methods,url,params){ export function $http(methods,url,params){
var header = { var header = {

5
app.json

@ -1,8 +1,9 @@
{ {
"pages": [ "pages": [
"pages/goodsList/index",
"pages/home/index", "pages/home/index",
"pages/home2/index", "pages/home2/index",
"pages/courseDetail/index", "pages/courseDetail/index",
"pages/companyInfo/index", "pages/companyInfo/index",
"pages/companyPage/index", "pages/companyPage/index",
@ -11,7 +12,7 @@
"pages/user/profit/index", "pages/user/profit/index",
"pages/user/cashOut/index", "pages/user/cashOut/index",
"pages/goodsDetail/index", "pages/goodsDetail/index",
"pages/goodsList/index",
"pages/login/index", "pages/login/index",
"pages/user/index", "pages/user/index",
"pages/user/myTeam/index" "pages/user/myTeam/index"

28
pages/courseDetail/index.js

@ -1,18 +1,30 @@
// pages/courseDetail/index.js // pages/courseDetail/index.js
const app = getApp()
const user = require('../../api/user.js')
const store = require('../../api/store.js')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
showMask: false,
form:{
name: '',
phone: '',
id: ''
},
detail: {}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({
'form.id': options.id
})
}, },
toReservation(){ toReservation(){
wx.navigateTo({ wx.navigateTo({
@ -30,9 +42,17 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.getProductDetail()
},
getProductDetail(){
store.getProductDetail(this.data.form.id).then((res)=>{
console.log('detail',res)
res.data.data.storeInfo.description.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"')
this.setData({
detail: res.data.data
})
})
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */

11
pages/courseDetail/index.wxml

@ -1,11 +1,11 @@
<!--pages/courseDetail/index.wxml--> <!--pages/courseDetail/index.wxml-->
<view class="detail-page"> <view class="detail-page">
<view class="subscribe"> <view class="subscribe">
<image src="../../images/coursepage.png" alt=""></image> <image src="{{detail.storeInfo.image}}" alt=""></image>
<view class="title acea-row row-center-wrapper">弘扬传统国学</view> <!-- <view class="title acea-row row-center-wrapper">{{detail.storeInfo.keyword}}</view> -->
<view class="subscribe-con"> <view class="subscribe-con">
<view class="headline">国学智慧-怎样学好国学</view> <view class="headline">{{detail.storeInfo.storeInfo}}</view>
<view class="subtitle">国学智慧-怎样学好国学</view> <view class="subtitle">{{detail.storeInfo.storeName}}</view>
<view class="placeicon acea-row row-middle"> <view class="placeicon acea-row row-middle">
<image src="../../images/placeicon.png"></image> <image src="../../images/placeicon.png"></image>
<text>武汉</text> <text>武汉</text>
@ -14,7 +14,7 @@
<image src="../../images/time.png"></image> <image src="../../images/time.png"></image>
<text>2021.11.13-11.15</text> <text>2021.11.13-11.15</text>
</view> </view>
<view class="num">22人已预约</view> <view class="num">{{detail.storeInfo.sales}}人已预约</view>
<view class="order-btn acea-row row-center-wrapper" bindtap="toReservation">去预约</view> <view class="order-btn acea-row row-center-wrapper" bindtap="toReservation">去预约</view>
</view> </view>
</view> </view>
@ -45,4 +45,5 @@
<image src="../../images/lh-bottom.png"></image> <image src="../../images/lh-bottom.png"></image>
</view> </view>
</view> </view>
</view> </view>

4
pages/courseDetail/index.wxss

@ -88,6 +88,7 @@
height: 416rpx; height: 416rpx;
margin-top: 20rpx; margin-top: 20rpx;
padding-left: 40rpx; padding-left: 40rpx;
display: none;
} }
.teach{ .teach{
padding-top: 28rpx; padding-top: 28rpx;
@ -140,4 +141,5 @@
.course-con view{ .course-con view{
color: #343434; color: #343434;
padding: 8rpx 22rpx 18rpx 24rpx; padding: 8rpx 22rpx 18rpx 24rpx;
} }

2
pages/goodsList/index.js

@ -30,7 +30,7 @@ Page({
toDetail(e){ toDetail(e){
let id = e.currentTarget.dataset.id let id = e.currentTarget.dataset.id
wx.navigateTo({ wx.navigateTo({
url: '/pages/goodsDetail/index?id=' + id, url: '/pages/courseDetail/index?id=' + id,
}) })
}, },
/** /**

11
pages/goodsList/index.wxml

@ -3,17 +3,18 @@
<view class="search-box acea-row row-middle row-between"> <view class="search-box acea-row row-middle row-between">
<view class="inp-box"> <view class="inp-box">
<image src="../../images/search.png"></image> <image src="../../images/search.png"></image>
</view> </view>
<view class="search-btn">搜一下</view> <view class="search-btn">搜一下</view>
</view> </view>
<view class="goods-list"> <view class="goods-list">
<view class="goods-item acea-row" wx:for="{{products}}" :key="index" bindtap="toDetail" data-id="id"> <view class="goods-item acea-row" wx:for="{{products}}" :key="index" bindtap="toDetail" data-id="{{item.id}}">
<image src="{{item.image}}" class="img" mode="aspectFill"></image> <image src="{{item.image}}" class="img" mode="aspectFill"></image>
<view class="goods-info"> <view class="goods-info">
<view class="name line1">无极先天密码</view> <view class="name line1">{{item.storeInfo}}</view>
<view class="tips">商道智慧</view> <!-- <view class="tips">商道智慧</view> -->
<view class="desc line1">{{item.storeName}}</view> <view class="desc line1">{{item.storeName}}</view>
<view class="location-box acea-row row-middle"> <!-- <view class="location-box acea-row row-middle">
<view class="address"> <view class="address">
<image src="../../images/address.png"></image> <image src="../../images/address.png"></image>
<text>武汉</text> <text>武汉</text>
@ -22,7 +23,7 @@
<image src="../../images/time.png"></image> <image src="../../images/time.png"></image>
<text>2021年11月25日</text> <text>2021年11月25日</text>
</view> </view>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>

11
pages/home/index.js

@ -49,16 +49,17 @@ Page({
} }
}) })
}, },
toDetial(){ toCompany(){
wx.navigateTo({ wx.navigateTo({
url: '/pages/goodsDetail/index', url: '/pages/companyPage/index',
}) })
}, },
toCompany(){ submitInfo(){
wx.navigateTo({ wx.switchTab({
url: '/pages/companyInfo/index', url: '/pages/goodsList/index',
}) })
}, },
//点击查看 //点击查看
toCheck(){ toCheck(){
wx.navigateTo({ wx.navigateTo({

4
pages/home/index.wxml

@ -2,7 +2,7 @@
<view class="home-page"> <view class="home-page">
<view class="top-box acea-row row-center-wrapper"> <view class="top-box acea-row row-center-wrapper">
<image src="../../images/yssh.png"></image> <image src="../../images/yssh.png"></image>
<view class="click acea-row row-center-wrapper">点击了解</view> <view class="click acea-row row-center-wrapper" bindtap="toCompany">点击了解</view>
</view> </view>
<view class="home-list-box"> <view class="home-list-box">
<view class="title">名师讲团</view> <view class="title">名师讲团</view>
@ -81,5 +81,5 @@
<view class="title">课程内容</view> <view class="title">课程内容</view>
<image src="../../images/home-footer.png"></image> <image src="../../images/home-footer.png"></image>
</view> </view>
<view class="btn-order acea-row row-center-wrapper">前去预约</view> <view class="btn-order acea-row row-center-wrapper" bindtap="submitInfo">前去预约</view>
</view> </view>

23
project.private.config.json

@ -0,0 +1,23 @@
{
"condition": {
"plugin": {
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": [
{
"name": "pages/courseDetail/index",
"pathName": "pages/courseDetail/index",
"query": "",
"scene": null
}
]
}
}
}
Loading…
Cancel
Save