Browse Source

Signed-off-by: yukangzhe <382985154@qq.com>

yukangzhe 4 years ago
parent
commit
16e98f13de

+ 2 - 0
app.json

@@ -1,6 +1,8 @@
 {
   "plugins": {},
   "pages": [
+    "pages/pianoDetail/pianoDetail",
+    "pages/pianoList/pianoList",
     "pages/myself/myself",
     "pages/classTotalList/classTotalList",
     "pages/teamWork/teamWork",

+ 142 - 0
pages/pianoDetail/pianoDetail.js

@@ -0,0 +1,142 @@
+// pages/pianoDetail/pianoDetail.js
+const app = getApp()
+const util = require("../../utils/util")
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    imageUrl: app.globalData.imageUrl,
+    num: 1,
+    initMoney:19.90,
+    item:{
+      name: '19.9元特惠练琴卡',
+      money: '19.90',
+      beginDate: '2021-01-01',
+      endDate: '2022-01-01'
+    },
+    id: "",
+    payFlag: 1,
+    schoolList:[],
+    moreFlag: 0,
+    isBuy: true,
+    downLoadShow: false
+  },
+
+  getMoreSchool:function(){
+    if(this.data.moreFlag == 0){
+      this.setData({
+        moreFlag: 1
+      })
+    } else{
+      this.setData({
+        moreFlag: 0
+      })
+    }
+  },
+
+  remNum:function(){
+    var num = this.data.num
+    if(num <= 1){
+      return false
+    } else {
+      num--
+      var money = this.data.initMoney
+      money = parseFloat(money) * parseFloat(num).toFixed(2)
+      this.setData({
+        num : num,
+       'item.money': money.toFixed(2)
+      })
+    }
+  },
+
+  addNum:function(){
+    var num = this.data.num
+    if(num >= 10){
+      wx.showToast({
+        title: '已达单次购买上限',
+        icon: "none"
+      })
+      return
+    }
+    num++;
+    var money = this.data.initMoney
+    money = parseFloat(money) * parseFloat(num).toFixed(2)
+    this.setData({
+      num:num,
+      'item.money': money.toFixed(2)
+    })
+  },
+
+  callPhone(e) {
+    const index = e.currentTarget.dataset.index
+    const phone = this.data.schoolList[index].CONTRACT_TELEPHONE
+   if(phone){
+    wx.makePhoneCall({
+      phoneNumber: phone
+    })
+   } else{
+     wx.showToast({
+       title: '暂无联系电话',
+       icon:"none"
+     })
+   }
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
pages/pianoDetail/pianoDetail.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "练琴卡详情",
+  "usingComponents": {}
+}

+ 113 - 0
pages/pianoDetail/pianoDetail.wxml

@@ -0,0 +1,113 @@
+<view class="container">
+    <navTop title="支付"></navTop>
+    <view class="top-view">
+      <view class="card-img">
+        <image mode="aspectFill" src="{{item.imgUrl ? item.imgUrl : 'https://file.schoolwisdoms.com/image/0e02f9fc-1d41-4551-a150-b1be8196b49d.jpg'}}"></image>
+      </view>
+      <view class="card-msg">
+        <view class="title">{{item.name}}</view>
+        <view class="detail">可转赠 不可退 火热抢购中</view>
+        <view class="time">有效期: {{item.beginDate}} 至 {{item.endDate}}</view>
+      </view>
+    </view>
+    <view class="mid-line"></view>
+    <view class="middle-view">
+      <view class="num-view">
+        <view class="label num-label">数量</view>
+        <view class="edit-num-view">
+          <view class="rem {{num == 1?'rem-false':''}}" bindtap="remNum">一</view>
+          <view class="num">{{num}}</view>
+          <view class="add {{num >= 10?'rem-false':''}}" bindtap="addNum">十</view>
+        </view>
+      </view>
+      <view class="total-view">
+        <view class="label">支付金额</view>
+        <view class="money-show-view">{{item.money}} 元</view>
+      </view>
+    </view>
+    <view class="school-view" wx:if="{{schoolList.length > 0}}">
+      <view class="school-title">
+        最近校区
+      </view>
+      <view class="dis-school">
+        <view class="school-msg">
+          <view class="school-name">{{schoolList[0].name}}</view>
+          <view class="school-addr">{{schoolList[0].address}}</view>
+        </view>
+        <view class="school-other">
+          <view class="dis-view" wx:if="{{schoolList[0].distance < 999999}}">{{schoolList[0].distance}}KM</view>
+          <view catchtap="callPhone" class="call-view" data-index="0" >
+            <image src="{{imageUrl ? imageUrl+'phone0615_2.png' : ''}}"  wx:if="{{schoolList[0].CONTRACT_TELEPHONE}}"></image>
+          </view>
+        </view>
+      </view>
+
+      <view class="dis-school" wx:for="{{schoolList}}" wx:key="index" wx:if="{{index > 0 && moreFlag == 1 }}">
+        <view class="school-msg">
+          <view class="school-name">{{item.name}}</view>
+          <view class="school-addr">{{item.address}}</view>
+        </view>
+        <view class="school-other">
+          <view class="dis-view" wx:if="{{schoolList[0].distance < 999999}}">{{item.distance}}KM</view>
+          <view catchtap="callPhone" class="call-view" data-index="{{index}}" >
+            <image src="{{imageUrl ? imageUrl+'phone0615_2.png' : ''}}"  wx:if="{{item.CONTRACT_TELEPHONE}}"></image>
+          </view>
+        </view>
+      </view>
+      <view class="other-school" bindtap="getMoreSchool">
+        <view>
+          全部适用门店
+        </view>
+        <view class="school-total">共{{schoolList.length}}家 > </view>
+      </view>
+    </view>
+    <view class="mid-line"></view>
+    <view class="tip-view">
+      <view class="tip-title">使用细则</view>
+      <view class="content">
+        <view>
+          1、7*24 随时约 ,约课时间在练琴卡有效期内即可
+        </view>
+        <view>
+          2、每人最多有2次约课机会,每次30分钟,(换句话说:一天最多可以约1个小时
+        </view>
+        <view>
+          3、必须消课后,该次数自动释放,(例如:某学生,约5号、6号各一次,当5号练完后,立刻释放一次约课机会,学生又可以约下一次)
+        </view>
+        <view>
+          4、惩罚机制:如旷课,未出席,所约课程结束时间起计算,惩罚72小时内无法约课,该惩罚时间可由学校自行设置。(例如:例如:某学生,约5号17:00-17:30、6号各一次,5号缺席,6号已约课程可正常出席,但无法再约课,且惩罚发的时间段为:5号的17:30起的72小时后)<br />
+        </view>
+        <view>
+          5、消息提醒推送:提前90分钟,主动推送给家长已约好的时间段提醒,给2个选择框:准时出席,请假
+        </view>
+        <view>
+          6、取消机制为:提前60分钟前取消,不予惩罚。请假的时间可由学校自行设置。
+        </view>
+        <view>
+          7、候补机制:当学生有约课机会时,如该时间段满员,该时段出现候补字样。所有的约课,都针对某一时间段的时间。
+        </view>
+        <view>
+          8、前台权限:如有家长忘记或遗漏选择请假,前台有释放任意空位的权限
+        </view>
+        <view>
+          9、考勤:在约可以的有效时间段内,学生可以进行人脸或指纹打卡
+        </view>
+        <view>
+          10、取消惩罚:校长对缺勤的学员取消预约限制
+        </view>
+      </view>
+    </view>
+    <view class="buy-btn" bindtap="tabBuy" wx:if="{{isBuy}}">
+      {{item.money}}元抢
+    </view>
+
+    <view class="buy-btn" bindtap="showDownLoad"  wx:if="{{!isBuy}}">
+      请前往App购买
+    </view>
+    <view class="downLoad-bg" bindtap="hideDownLoad" wx:if="{{downLoadShow}}"></view>
+    <view class="downLoad-code" wx:if="{{downLoadShow}}">
+        <image src="/images/ewm.png"></image>
+        <view class="code-tip">安卓用户可以扫码下载,苹果用户请前往AppStore下载</view>
+    </view>
+
+  </view>

+ 284 - 0
pages/pianoDetail/pianoDetail.wxss

@@ -0,0 +1,284 @@
+/* pages/buyCard/buyCard.wxss */
+.container {
+  width: 750rpx;
+  padding: 0;
+  margin: 0;
+}
+
+.top-view {
+  display: flex;
+  width: 700rpx;
+  margin: 0 25rpx;
+  padding-bottom: 20rpx;
+}
+
+.card-img {
+  width: 240rpx;
+  height: 180rpx;
+  margin-right: 20rpx;
+}
+
+.card-img image {
+  width: 100%;
+  height: 100%;
+  border-radius: 5rpx;
+}
+
+.card-msg {
+  width: 440rpx;
+}
+
+.card-msg view {
+  width: 440rpx;
+}
+
+.title {
+  height: 80rpx;
+  line-height: 40rpx;
+  font-size: 32rpx;
+  width: 500rpx;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+  display: -webkit-box;
+
+}
+
+.detail {
+  font-size: 28rpx;
+  height: 70rpx;
+  line-height: 35rpx;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+  display: -webkit-box;
+  color: #333;
+}
+
+.time {
+  font-size: 24rpx;
+  color: #999;
+  height: 30rpx;
+  width: 500rpx;
+}
+
+.mid-line {
+  background: #f1f1f1;
+  height: 10rpx;
+  width: 750rpx;
+}
+
+.middle-view {
+  width: 700rpx;
+  margin: 0 25rpx;
+  padding: 20rpx 0;
+}
+
+.middle-view>view {
+  display: flex;
+  width: 100%;
+}
+
+.edit-num-view {
+  display: flex;
+}
+
+.label {
+  width: 200rpx;
+  text-align: left;
+  font-size: 32rpx;
+}
+
+.edit-num-view,
+.money-show-view {
+  margin-left: auto;
+}
+
+.money-show-view {
+  color: #cc6031;
+  font-size: 32rpx;
+}
+
+.edit-num-view view {
+  text-align: center;
+}
+
+.rem,
+.add {
+  font-size: 24rpx;
+  background: #2872DD;
+  color: #FFF;
+  width: 45rpx;
+  height: 45rpx;
+  line-height: 45rpx;
+  border-radius: 50rpx;
+  margin-top: 5rpx;
+}
+
+.num {
+  width: 100rpx;
+  height: 50rpx;
+  line-height: 50rpx;
+  font-size: 32rpx;
+}
+
+.num-view,
+.total-view {
+  border-bottom: 2px solid #f1f1f1;
+  padding: 30rpx 0;
+}
+
+.num-label {
+  color: #999;
+}
+
+.school-view {
+  width: 700rpx;
+  margin: 25rpx;
+}
+
+.school-title {
+  font-size: 32rpx;
+  height: 50rpx;
+  line-height: 50rpx;
+  border-bottom: 2px solid #f1f1f1;
+  padding: 20rpx 0;
+}
+
+.dis-school {
+  display: flex;
+  border-bottom: 2px solid #f1f1f1;
+  padding-bottom: 30rpx;
+}
+
+.school-msg {
+  width: 460rpx;
+}
+
+.school-other {
+  display: flex;
+  margin-left: auto;
+  max-width: 220rpx;
+  min-width: 100rpx;
+}
+
+.school-name {
+  height: 50rpx;
+  line-height: 50rpx;
+  padding: 20rpx 0 10rpx;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+
+.dis-view {
+  height: 80rpx;
+  line-height: 80rpx;
+  border-right: 2px solid #f2f2f2;
+  margin-top: 30rpx;
+  width: 140rpx;
+  text-align: center;
+  font-size: 24rpx;
+  color: #999;
+}
+
+.school-other image {
+  width: 60rpx;
+  height: 60rpx;
+  margin-top: 40rpx;
+  margin-left: 20rpx;
+}
+
+.school-addr {
+  color: #999;
+  font-size: 24rpx;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+}
+
+.other-school {
+  display: flex;
+  height: 100rpx;
+  line-height: 100rpx;
+  font-size: 32rpx;
+  width: 700rpx;
+}
+
+.school-total {
+  margin-left: auto;
+}
+
+.tip-view {
+  width: 700rpx;
+  margin: 25rpx;
+}
+
+.tip-title {
+  font-size: 36rpx;
+  height: 60rpx;
+  line-height: 60rpx;
+}
+
+.buy-btn {
+  width: 700rpx;
+  height: 100rpx;
+  line-height: 100rpx;
+  text-align: center;
+  position: fixed;
+  bottom: 20px;
+  left: 25rpx;
+  font-size: 40rpx;
+  font-weight: 600;
+  background: #cc6031;
+  color: #FFF;
+  border-radius: 10rpx;
+}
+
+.rem-false {
+  background: #b1b1b1;
+}
+
+.content {
+  font-size: 24rpx;
+  color: #666;
+}
+.downLoad-bg,.downLoad-code{
+  position: fixed;
+  width: 750rpx;
+  height: 100%;
+}
+.downLoad-bg{
+  background: #333;
+  opacity: 0.2;
+  top: 0;
+  left: 0;
+}
+.downLoad-code{
+  background: #FFF;
+    height: 700rpx;
+    top: 50%;
+    margin-top: -300rpx;
+    width: 600rpx;
+}
+.downLoad-code image{
+  position: fixed;
+  width: 400rpx;
+  height: 400rpx;
+  top: 50%;
+  left: 50%;
+  margin-top: -200rpx;
+  margin-left: -200rpx;
+}
+.code-tip{
+  text-align: center;
+  position: absolute;
+  width: 500rpx;
+  margin: 0 50rpx;
+  top: 550rpx;
+  line-height: 45rpx;
+}

+ 70 - 0
pages/pianoList/pianoList.js

@@ -0,0 +1,70 @@
+// pages/pianoList/pianoList.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    list:[
+      {name: '19.9特惠练琴卡',money: '19.90',days: '30'},
+      {name: '19.9特惠练琴卡',money: '19.90',days: '30'},
+      {name: '19.9特惠练琴卡',money: '19.90',days: '30'},
+    ]
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
pages/pianoList/pianoList.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "练琴卡",
+  "usingComponents": {}
+}

+ 12 - 0
pages/pianoList/pianoList.wxml

@@ -0,0 +1,12 @@
+<view class="container">
+  <view class="card-box">
+    <view class="card-list" wx:for="{{list}}" wx:key="index" data-index="{{index}}" bindtap="getCard">
+      <view class="card-img">
+        <image mode="aspectFill" src="{{item.imgUrl ? item.imgUrl : 'https://file.schoolwisdoms.com/image/0e02f9fc-1d41-4551-a150-b1be8196b49d.jpg'}}" ></image>
+      </view>
+      <view class="card-name">{{item.name}}</view>
+      <view class="card-price">¥{{item.money}}</view>
+      <view class="card-days">有效期{{item.days}}天</view>
+    </view>
+  </view>
+</view> 

+ 56 - 0
pages/pianoList/pianoList.wxss

@@ -0,0 +1,56 @@
+/* pages/chinka/chinka.wxss */
+.container{
+  padding: 0;
+  margin: 0;
+  width: 100%;
+}
+
+.card-box{
+  width: 700rpx;
+  margin: 0 25rpx;
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: space-between;
+}
+.card-list{
+  width: 320rpx;
+  background: #f1f1f1;
+  padding-top: 20rpx;
+  padding: 20rpx 10rpx;
+  margin-top: 20rpx;
+  border-radius: 20rpx;
+}
+.card-img{
+  width: 310rpx;
+  height: 170rpx;
+  margin: 0 5rpx;
+}
+.card-img image{
+  width: 100%;
+  height: 100%;
+  border-radius: 10rpx;
+}
+.card-price,.card-days{
+  display: inline-block;
+  width: 155rpx;
+  line-height: 32rpx;
+  font-size: 24rpx;
+  overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+}
+.card-name{
+  width: 310rpx;
+  font-size: 28rpx;
+  height: 60rpx;
+  line-height: 60rpx;
+  overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+}
+.card-price{
+  color: #cc6031;
+}
+.card-days{
+  text-align: right;
+}

+ 1 - 0
pages/teamWork/teamWork.json

@@ -1,3 +1,4 @@
 {
+  "navigationBarTitleText": "商务合作",
   "usingComponents": {}
 }