qianxinyu 3 ماه پیش
والد
کامیت
448101080c

+ 162 - 0
components/FollowPopup/FollowPopup.vue

@@ -0,0 +1,162 @@
+<template>
+  <view class="add_follow">
+    <view class="close_area"><button class="close_btn" @click="closePopup">关闭</button></view>
+    <view class="info_alter">
+      <text v-show="follow_linkurl">{{ clickTitle }}</text>
+      <text v-show="!follow_linkurl">{{ longTapTitle }}</text>
+    </view>
+    <view v-if="!picUrl" class="qr_code_area" @click="followLinkurl">
+      <image :src="followQrcode" class="qr_code" mode="" show-menu-by-longpress> </image>
+    </view>
+    <view v-if="picUrl">
+      <view class="qr_code_area" @click="followLinkurl">
+        <image :src="picUrl" class="qr_code" mode="" show-menu-by-longpress> </image>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  props: {
+    //关闭弹窗
+    closePopup: {
+      type: Function,
+      required: true,
+    },
+    showRule: {
+      type: Boolean,
+      default: true,
+    },
+    clickTitle: {
+      type: String,
+      default: "点击二维码添加客服",
+    },
+    longTapTitle: {
+      type: String,
+      default: "长按二维码添加客服",
+    },
+    picUrl: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      follow_linkurl: this.$checkAccess.getFollowLinkUrl(),
+      followQrcode: this.$checkAccess.getFollowQrcode(),
+    };
+  },
+  methods: {
+    // 去往webview
+    followLinkurl() {
+      // 获取登录标识
+      let userInfo = uni.getStorageSync("userInfo");
+      // 如果不存在的话
+      if (!userInfo) return "";
+      // 未添加好友
+      if (!userInfo.follow_linkurl) return "";
+      // 获取Url
+      let url = userInfo.follow_linkurl;
+      // 没有路径,不跳转
+      if (!url) return;
+      // 判断是不是小程序链接
+      if (url.includes("http")) {
+        // 转码
+        let link_url = encodeURIComponent(url);
+        // 跳转到webview
+        uni.redirectTo({
+          url: `/pages/webview/index?link_url=${link_url}`,
+        });
+      } else {
+        // 跳转到webview
+        uni.navigateTo({
+          url: url,
+        });
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.add_follow {
+  display: block;
+  color: #ffffff;
+  width: 700rpx;
+  height: 800rpx;
+  margin: 0 auto;
+  font-size: 26rpx;
+  border-radius: 40rpx;
+  background: linear-gradient(to bottom, #ff0091 0%, #2c82ff 100%);
+
+  .close_area {
+    height: 80rpx;
+    display: block;
+    line-height: 80rpx;
+
+    .close_btn {
+      color: #ffffff;
+      float: right;
+      width: 80rpx;
+      height: 80rpx;
+      font-size: 26rpx;
+      text-align: center;
+      line-height: 80rpx;
+      padding: 0rpx 0rpx;
+      border: 0rpx solid transparent;
+      background-color: transparent;
+    }
+
+    .close_btn::after {
+      border: 0rpx solid transparent;
+    }
+  }
+
+  .info_alter {
+    display: block;
+    height: 100rpx;
+    font-size: 42rpx;
+    font-weight: bold;
+    text-align: center;
+    line-height: 100rpx;
+  }
+
+  .qr_code_area {
+    display: block;
+    width: 300rpx;
+    height: 300rpx;
+    margin: 30rpx auto;
+
+    .qr_code {
+      float: left;
+      width: 300rpx;
+      height: 300rpx;
+    }
+  }
+
+  .save_btn {
+    color: #333333;
+    display: block;
+    width: 260rpx;
+    height: 80rpx;
+    font-size: 26rpx;
+    text-align: center;
+    line-height: 80rpx;
+    padding: 0rpx 0rpx;
+    margin: 40rpx auto;
+    border-radius: 40rpx;
+    background-color: #ffffff;
+    border: 0rpx solid transparent;
+  }
+
+  .rule_info {
+    width: 600rpx;
+    display: block;
+    font-size: 26rpx;
+    margin: 20rpx auto;
+    overflow: hidden;
+    line-height: 40rpx;
+  }
+}
+</style>

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "KIRIN",
-    "appid" : "__UNI__79FF0C2",
+    "appid" : "__UNI__D691B2C",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",

+ 234 - 246
pages.json

@@ -1,248 +1,236 @@
 {
-	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-		{
-			"path": "pages/index/index",
-			"style": {
-				"navigationBarTitleText": "KIRIN",
-				"enablePullDownRefresh": true
-			}
-		},
-		{
-			"path": "pages/car/index",
-			"style": {
-				"navigationBarTitleText": "购物车"
-			}
-		},
-		{
-			"path": "pages/car/order",
-			"style": {
-				"navigationBarTitleText": "提交订单"
-			}
-		},
-		{
-			"path": "pages/user/index",
-			"style": {
-				"navigationBarTitleText": "我的"
-			}
-		},
-		{
-			"path": "pages/user/settings",
-			"style": {
-
-				"navigationBarTitleText": "设置"
-			}
-		},
-		{
-			"path" : "pages/coupon/index",
-			"style" :
-			{
-				"navigationBarTitleText" : "优惠券",
-				"enablePullDownRefresh": true
-			}
-		},
-		{
-			"path" : "pages/orders/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "预约中心",
-				"enablePullDownRefresh": true
-			}
-		},
-		{
-			"path" : "pages/product/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "商品详情"
-			}
-		},
-		{
-			"path" : "pages/user/info",
-			"style" : 
-			{
-				"navigationBarTitleText" : "信息设置"
-			}
-		},
-		{
-			"path" : "pages/login/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "登录注册"
-			}
-		},
-		{
-			"path" : "pages/bind/user",
-			"style" : 
-			{
-				"navigationBarTitleText" : "客户绑定"
-			}
-		},
-		{
-			"path" : "pages/addr/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "收货地址"
-			}
-		},
-		{
-			"path" : "pages/score/record",
-			"style" : 
-			{
-				"navigationBarTitleText" : "积分记录",
-				"enablePullDownRefresh": true
-			}
-		},
-		{
-			"path" : "pages/score/clockin",
-			"style" : 
-			{
-				"navigationBarTitleText" : "积分签到",
-				"navigationStyle":"custom"
-			}
-		},
-		{
-			"path" : "pages/score/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "积分产品"
-			}
-		},
-		{
-			"path" : "pages/score/product",
-			"style" : 
-			{
-				"navigationBarTitleText" : "产品详情"
-			}
-		},
-		{
-			"path" : "pages/score/orders",
-			"style" : 
-			{
-				"navigationBarTitleText" : "兑换记录"
-			}
-		},
-		{
-			"path" : "pages/orders/completion",
-			"style" : 
-			{
-				"navigationBarTitleText" : "报单成功"
-			}
-		},
-		{
-			"path" : "pages/webview/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "活动页面"
-			}
-		},
-		{
-			"path" : "pages/user/follow",
-			"style" : 
-			{
-				"navigationBarTitleText" : "添加客服"
-			}
-		},
-		{
-			"path" : "pages/coupon/product",
-			"style" : 
-			{
-				"navigationBarTitleText" : "可用商品"
-			}
-		},
-		{
-			"path" : "pages/score/lottery",
-			"style" : 
-			{
-				"navigationBarTitleText" : "积分抽奖"
-			}
-		},
-		{
-			"path" : "pages/coupon/active",
-			"style" : 
-			{
-				"navigationBarTitleText" : "领券活动"
-			}
-		},
-		{
-			"path" : "pages/orders/lottery",
-			"style" : 
-			{
-				"navigationBarTitleText" : "下单抽奖"
-			}
-		},
-		{
-			"path" : "pages/orders/receipt",
-			"style" : 
-			{
-				"navigationBarTitleText" : "订单回执"
-			}
-		},
-		{
-			"path" : "pages/course/reservation",
-			"style" :
-			{
-				"navigationBarTitleText" : "课程预约"
-			}
-		},
-		{
-			"path" : "pages/course/usercourse",
-			"style" :
-			{
-				"navigationBarTitleText" : "我的课程"
-			}
-		},
-		{
-			"path" : "pages/course/index",
-			"style" :
-			{
-				"navigationBarTitleText" : "上课"
-			}
-		},
-		{
-			"path" : "pages/orders/confirm",
-			"style" :
-			{
-				"navigationBarTitleText" : "确认支付"
-			}
-		}
-	],
-	"globalStyle": {
-		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "uni-app",
-		"navigationBarBackgroundColor": "#F8F8F8",
-		"backgroundColor": "#F8F8F8"
-	},
-	"uniIdRouter": {},
-	"tabBar": {
-		"color": "#333333",
-		"selectedColor": "#333333",
-		"backgroundColor": "#F8F8F8",
-		"borderStyle": "white",
-		"position": "bottom",
-		"list": [{
-			"pagePath": "pages/index/index",
-			"iconPath": "static/icon/home.png",
-			"selectedIconPath": "static/icon/home_active.png",
-			"text": "首页"
-		},{
-			"pagePath": "pages/score/index",
-			"iconPath": "static/tabbar/score.png",
-			"selectedIconPath": "static/tabbar/score_active.png",
-			"text": "积分"
-		}, {
-			"pagePath": "pages/course/index",
-			"iconPath": "static/tabbar/clockin.png",
-			"selectedIconPath": "static/tabbar/clockin_active.png",
-			"text": "上课"
-		},{
-			"pagePath": "pages/car/index",
-			"iconPath": "static/icon/car.png",
-			"selectedIconPath": "static/icon/car_active.png",
-			"text": "购物车"
-		}, {
-			"pagePath": "pages/user/index",
-			"iconPath": "static/icon/user.png",
-			"selectedIconPath": "static/icon/user_active.png",
-			"text": "我的"
-		}]
-	}
+  "pages": [
+    //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+    {
+      "path": "pages/index/index",
+      "style": {
+        "navigationBarTitleText": "鹏城征订",
+        "enablePullDownRefresh": true
+      }
+    },
+    {
+      "path": "pages/car/index",
+      "style": {
+        "navigationBarTitleText": "购物车"
+      }
+    },
+    {
+      "path": "pages/car/order",
+      "style": {
+        "navigationBarTitleText": "提交订单"
+      }
+    },
+    {
+      "path": "pages/user/index",
+      "style": {
+        "navigationBarTitleText": "我的"
+      }
+    },
+    {
+      "path": "pages/user/settings",
+      "style": {
+        "navigationBarTitleText": "设置"
+      }
+    },
+    {
+      "path": "pages/coupon/index",
+      "style": {
+        "navigationBarTitleText": "优惠券",
+        "enablePullDownRefresh": true
+      }
+    },
+    {
+      "path": "pages/orders/index",
+      "style": {
+        "navigationBarTitleText": "我的订单",
+        "enablePullDownRefresh": true
+      }
+    },
+    {
+      "path": "pages/product/index",
+      "style": {
+        "navigationBarTitleText": "商品详情"
+      }
+    },
+    {
+      "path": "pages/user/info",
+      "style": {
+        "navigationBarTitleText": "信息设置"
+      }
+    },
+    {
+      "path": "pages/login/index",
+      "style": {
+        "navigationBarTitleText": "登录注册"
+      }
+    },
+    {
+      "path": "pages/bind/user",
+      "style": {
+        "navigationBarTitleText": "客户绑定"
+      }
+    },
+    {
+      "path": "pages/addr/index",
+      "style": {
+        "navigationBarTitleText": "收货地址"
+      }
+    },
+    {
+      "path": "pages/addr/order",
+      "style": {
+        "navigationBarTitleText": "收货地址"
+      }
+    },
+    {
+      "path": "pages/score/record",
+      "style": {
+        "navigationBarTitleText": "积分记录",
+        "enablePullDownRefresh": true
+      }
+    },
+    {
+      "path": "pages/score/clockin",
+      "style": {
+        "navigationBarTitleText": "积分签到",
+        "navigationStyle": "custom"
+      }
+    },
+    {
+      "path": "pages/score/index",
+      "style": {
+        "navigationBarTitleText": "积分产品"
+      }
+    },
+    {
+      "path": "pages/score/product",
+      "style": {
+        "navigationBarTitleText": "产品详情"
+      }
+    },
+    {
+      "path": "pages/score/orders",
+      "style": {
+        "navigationBarTitleText": "兑换记录"
+      }
+    },
+    {
+      "path": "pages/orders/completion",
+      "style": {
+        "navigationBarTitleText": "报单成功"
+      }
+    },
+    {
+      "path": "pages/webview/index",
+      "style": {
+        "navigationBarTitleText": "活动页面"
+      }
+    },
+    {
+      "path": "pages/user/follow",
+      "style": {
+        "navigationBarTitleText": "添加客服"
+      }
+    },
+    {
+      "path": "pages/coupon/product",
+      "style": {
+        "navigationBarTitleText": "可用商品"
+      }
+    },
+    {
+      "path": "pages/score/lottery",
+      "style": {
+        "navigationBarTitleText": "积分抽奖"
+      }
+    },
+    {
+      "path": "pages/coupon/active",
+      "style": {
+        "navigationBarTitleText": "领券活动"
+      }
+    },
+    {
+      "path": "pages/orders/lottery",
+      "style": {
+        "navigationBarTitleText": "下单抽奖"
+      }
+    },
+    {
+      "path": "pages/orders/receipt",
+      "style": {
+        "navigationBarTitleText": "订单回执"
+      }
+    },
+    {
+      "path": "pages/course/reservation",
+      "style": {
+        "navigationBarTitleText": "课程预约"
+      }
+    },
+    {
+      "path": "pages/course/usercourse",
+      "style": {
+        "navigationBarTitleText": "我的课程"
+      }
+    },
+    {
+      "path": "pages/course/index",
+      "style": {
+        "navigationBarTitleText": "上课"
+      }
+    },
+    {
+      "path": "pages/orders/confirm",
+      "style": {
+        "navigationBarTitleText": "确认支付"
+      }
+    },
+    {
+      "path": "pages/services/index",
+      "style": {
+        "navigationBarTitleText": "添加客服"
+      }
+    }
+  ],
+  "globalStyle": {
+    "navigationBarTextStyle": "black",
+    "navigationBarTitleText": "uni-app",
+    "navigationBarBackgroundColor": "#F8F8F8",
+    "backgroundColor": "#F8F8F8"
+  },
+  "uniIdRouter": {},
+  "tabBar": {
+    "color": "#333333",
+    "selectedColor": "#333333",
+    "backgroundColor": "#F8F8F8",
+    "borderStyle": "white",
+    "position": "bottom",
+    "list": [
+      {
+        "pagePath": "pages/index/index",
+        "iconPath": "static/icon/home.png",
+        "selectedIconPath": "static/icon/home_active.png",
+        "text": "首页"
+      },
+      {
+        "pagePath": "pages/score/index",
+        "iconPath": "static/tabbar/score.png",
+        "selectedIconPath": "static/tabbar/score_active.png",
+        "text": "积分"
+      },
+      {
+        "pagePath": "pages/car/index",
+        "iconPath": "static/icon/car.png",
+        "selectedIconPath": "static/icon/car_active.png",
+        "text": "购物车"
+      },
+      {
+        "pagePath": "pages/user/index",
+        "iconPath": "static/icon/user.png",
+        "selectedIconPath": "static/icon/user_active.png",
+        "text": "我的"
+      }
+    ]
+  }
 }

+ 452 - 460
pages/addr/index.vue

@@ -1,467 +1,459 @@
 <template>
-	
-	<view>
-		<view class="to_bottom" v-if="!addrList.length"> -----还没有地址啦-----</view>
-		<view class="addr_list">
-			<view class="addr_item" v-for="(item,index) in addrList" :key="index" >
-				<view class="contact_user">
-					<text class="contact_name">{{item.contact_name}}</text>
-					<text class="contact_phone">{{item.contact_phone}}</text>
-					<text class="contact_shop">{{item.contact_shop}}</text>
-				</view>
-				<view class="contact_addr">
-					{{item.contact_province}} {{item.contact_city}} {{item.contact_area}} {{item.contact_addr}}
-				</view>
-				<view class="contact_handler">
-					<view class="radio_label" @click="setDefault(index)">
-						<image class="radio_icon" :src="item.is_default?'../../static/icon/radioed.png' :'../../static/icon/radio.png' " ></image> 
-						<text :class="item.is_default?'radioed_text':''">{{item.is_default?'已默认':'设为默认'}}</text>
-					</view>
-					<view class="addr_right_btn" @click="removeAddr(index)">
-						删除
-					</view>
-					<view class="addr_right_btn" @click="openForm(item)">
-						编辑
-					</view>
-				</view>
-			</view>
-		</view>
-		<view class="create_box">
-			<button class="create_addr" @click="openForm()">新建收货地址</button>
-		</view>
-		<view class="to_bottom" v-if="isLast"> -----到底啦-----</view>
-		<uni-popup ref="addrForm" type="bottom" class="popup" background-color="#FFFFFF" @change="popupChange">
-			<view class="contact_addr_form">
-				<!-- 地区代表表单 -->
-				<form class="info_form">
-					<view class="form_group">
-						<view class="group_title">收货人:</view>
-						<view class="group_box">
-							<input type="text" class="form_ctrl" placeholder="请输入收件人" maxlength="20" required="" v-model="addrRequest.contact_name" />
-						</view>
-					</view>
-					<view class="form_group">
-						<view class="group_title">手机号:</view>
-						<view class="group_box">
-							<input type="text" class="form_ctrl" placeholder="请输入手机号" maxlength="11" required="" v-model="addrRequest.contact_phone" />
-						</view>
-					</view>
-					<view class="form_group">
-						<view class="group_title">店铺名称:</view>
-						<view class="group_box">
-							<input type="text" class="form_ctrl" placeholder="请输入店铺名称" maxlength="20" required="" v-model="addrRequest.contact_shop" />
-						</view>
-					</view>
-					<view class="form_group">
-						<view class="group_title">所在地区:</view>
-						<view class="group_box">
-							<picker mode="multiSelector" class="form_ctrl" :range="cityArray"  @columnchange="cityChange" @change="cityFinish" >
-								<view class="area_text">
-									<text v-if="addrRequest.contact_province">{{addrRequest.contact_province}}</text>
-									<text v-if="addrRequest.contact_city">/{{addrRequest.contact_city}}</text>
-									<text v-if="addrRequest.contact_area">/{{addrRequest.contact_area}}</text>
-								</view>
-							</picker>
-						</view>
-					</view>
-					<view class="form_group">
-						<view class="group_title">详细地址:</view>
-						<view class="group_box">
-							<input type="text" class="form_ctrl" placeholder="请输入详细地址:街道/小区/门牌号" maxlength="64" required="" v-model="addrRequest.contact_addr" />
-						</view>
-					</view>
-					<view class="form_group">
-						<view class="group_title">设为默认</view>
-						<view class="group_box">
-							<switch color="#E03519" style="transform:scale(0.6);float: right;" @change="defaultSwitch" :checked="addrRequest.is_default?true:false" />
-						</view>
-					</view>
-					<button class="submit_btn"  @click="saveAddr">保存地址</button>
-				</form>
-			</view>
-		</uni-popup>
-	</view>
-	
+  <view>
+    <view class="to_bottom" v-if="!addrList.length"> -----还没有地址啦-----</view>
+    <view class="addr_list">
+      <view class="addr_item" v-for="(item, index) in addrList" :key="index">
+        <view class="contact_user">
+          <text class="contact_name">{{ item.contact_name }}</text>
+          <text class="contact_phone">{{ item.contact_phone }}</text>
+          <text class="contact_shop">{{ item.contact_shop }}</text>
+        </view>
+        <view class="contact_addr"> {{ item.contact_province }} {{ item.contact_city }} {{ item.contact_area }} {{ item.contact_addr }} </view>
+        <view class="contact_handler">
+          <view class="radio_label" @click="setDefault(index)">
+            <image class="radio_icon" :src="item.is_default ? '../../static/icon/radioed.png' : '../../static/icon/radio.png'"></image>
+            <text :class="item.is_default ? 'radioed_text' : ''">{{ item.is_default ? "已默认" : "设为默认" }}</text>
+          </view>
+          <view class="addr_right_btn" @click="removeAddr(index)"> 删除 </view>
+          <view class="addr_right_btn" @click="openForm(item)"> 编辑 </view>
+        </view>
+      </view>
+    </view>
+    <view class="create_box">
+      <button class="create_addr" @click="openForm()">新建收货地址</button>
+    </view>
+    <view class="to_bottom" v-if="isLast"> -----到底啦-----</view>
+    <uni-popup ref="addrForm" type="bottom" class="popup" background-color="#FFFFFF" @change="popupChange">
+      <view class="contact_addr_form">
+        <!-- 地区代表表单 -->
+        <form class="info_form">
+          <view class="form_group">
+            <view class="group_title">收货人:</view>
+            <view class="group_box">
+              <input type="text" class="form_ctrl" placeholder="请输入收件人" maxlength="20" required="" v-model="addrRequest.contact_name" />
+            </view>
+          </view>
+          <view class="form_group">
+            <view class="group_title">手机号:</view>
+            <view class="group_box">
+              <input type="text" class="form_ctrl" placeholder="请输入手机号" maxlength="11" required="" v-model="addrRequest.contact_phone" />
+            </view>
+          </view>
+          <view class="form_group">
+            <view class="group_title">店铺名称:</view>
+            <view class="group_box">
+              <input type="text" class="form_ctrl" placeholder="请输入店铺名称" maxlength="20" required="" v-model="addrRequest.contact_shop" />
+            </view>
+          </view>
+          <view class="form_group">
+            <view class="group_title">所在地区:</view>
+            <view class="group_box">
+              <picker mode="multiSelector" class="form_ctrl" :range="cityArray" @columnchange="cityChange" @change="cityFinish">
+                <view class="area_text">
+                  <text v-if="addrRequest.contact_province">{{ addrRequest.contact_province }}</text>
+                  <text v-if="addrRequest.contact_city">/{{ addrRequest.contact_city }}</text>
+                  <text v-if="addrRequest.contact_area">/{{ addrRequest.contact_area }}</text>
+                </view>
+              </picker>
+            </view>
+          </view>
+          <view class="form_group">
+            <view class="group_title">详细地址:</view>
+            <view class="group_box">
+              <input type="text" class="form_ctrl" placeholder="请输入详细地址:街道/小区/门牌号" maxlength="64" required="" v-model="addrRequest.contact_addr" />
+            </view>
+          </view>
+          <view class="form_group">
+            <view class="group_title">设为默认</view>
+            <view class="group_box">
+              <switch color="#E03519" style="transform: scale(0.6); float: right" @change="defaultSwitch" :checked="addrRequest.is_default ? true : false" />
+            </view>
+          </view>
+          <button class="submit_btn" @click="saveAddr">保存地址</button>
+        </form>
+      </view>
+    </uni-popup>
+  </view>
 </template>
 
 <script>
-	import {getProvinces,getMyCity,getAreas} from "../../utils/city";
-	export default {
-		data() {
-			return {
-				// 产品列表
-				addrList:[],
-				// 请求参数
-				requestParam:{
-					page:1,
-					status:0,
-				},
-				// 保存地址
-				addrRequest:{
-					id:0,
-					contact_name:"",
-					contact_phone:"",
-					contact_province:"",
-					contact_city:"",
-					contact_area:"",
-					contact_addr:"",
-					contact_shop:"",
-					is_default:0,
-				},
-				// 是否最后一页
-				isLast:false,
-				// 是否请求中
-				isReqing:false,
-				// 所在地区
-				cityArray: [[],[],[]],
-				cityValue: [0,0,0],
-				// 自动弹出
-				autoShowForm: false,
-				// 异步通知
-				AddrEmit: false,
-			};
-		},
-		onLoad(param) {
-			this.AddrEmit 	  = param.notify == 'addr' ? true : false;
-			this.autoShowForm = param.type == 'create' ? true : false;
-			// 获取列表
-			this.getList();
-		},
-		onReady() {
-			if( this.autoShowForm ){
-				var that = this;
-				// 500毫秒后自动弹出
-				setTimeout(function(){
-					that.openForm();
-				},500)
-			}
-		},
-		onShow() {
-			// 替换对应的数据
-			this.cityArray.splice(0,1,getProvinces());
-			this.cityArray.splice(1,1,getMyCity(this.cityValue[0]));
-			this.cityArray.splice(2,1,getAreas(this.cityValue[0],this.cityValue[1]));
-			// 默认地址
-			this.addrRequest.contact_province 	= this.cityArray[0][this.cityValue[0]]
-			this.addrRequest.contact_city 		= this.cityArray[1][this.cityValue[1]];
-			this.addrRequest.contact_area 		= this.cityArray[2][this.cityValue[2]];
-		},
-		methods:{
-			// 获取列表
-			getList(){
-				// 登录提示
-				if( !this.$checkAccess.alterLogin() ) return ;
-				// 判断数据
-				this.$http.request('api/custom_addr/get_list').then((callback)=>{
-					// 获取成功
-					if( callback.code == 'success' ){
-						this.addrList  = callback.data;
-						// 通知地址变更
-						if( this.AddrEmit ) uni.$emit('addr_list_change',{list:this.addrList});
-					}
-				});
-			},
-			// 打开弹窗
-			openForm(item){
-				if( !item )		{
-					this.addrRequest.id = 0;
-					this.addrRequest.contact_name = '';
-					this.addrRequest.contact_phone = '';
-					this.addrRequest.contact_shop = '';
-					this.addrRequest.contact_addr = '';
-					this.addrRequest.is_default = 0;
-				}else{
-					this.addrRequest  = item;
-				}
-				// 显示下单弹出层
-				this.$refs.addrForm.open('bottom');
-			},
-			// 默认开关
-			defaultSwitch(e){
-				this.addrRequest.is_default = e.detail.value ? 1 : 0;
-			},
-			// 弹出层
-			popupChange(e){
-				// 禁止滚动穿透
-				this.show = e.show
-			},
-			// 城市修改
-			cityChange(e){
-				// 替换三个选项
-				this.cityValue.splice(e.detail.column,1,e.detail.value);
-				// 下一级设置为0
-				if( e.detail.column == 0 ){
-					this.cityValue.splice(1,1,0);
-					this.cityValue.splice(2,1,0);
-				}
-				if( e.detail.column == 1 ){
-					this.cityValue.splice(2,1,0);
-				}
-				// 替换对应的数据
-				this.cityArray.splice(0,1,getProvinces());
-				this.cityArray.splice(1,1,getMyCity(this.cityValue[0]));
-				this.cityArray.splice(2,1,getAreas(this.cityValue[0],this.cityValue[1]));
-			},
-			// 城市选择
-			cityFinish(e){
-				this.addrRequest.contact_province 	= this.cityArray[0][this.cityValue[0]];
-				this.addrRequest.contact_city 		= this.cityArray[1][this.cityValue[1]];
-				this.addrRequest.contact_area 		= this.cityArray[2][this.cityValue[2]];
-			},
-			// 城市选中
-			cityFinish(e){
-				this.addrRequest.contact_province 	= this.cityArray[0][this.cityValue[0]];
-				this.addrRequest.contact_city 		= this.cityArray[1][this.cityValue[1]];
-				this.addrRequest.contact_area 		= this.cityArray[2][this.cityValue[2]];
-			},
-			// 保存地址
-			saveAddr(){
-				// 判断姓名
-				if( !this.addrRequest.contact_name ){
-					uni.showToast({icon:"none",title:"请填写收件人"});
-					return;
-				}
-				if( this.addrRequest.contact_name.length < 2 ){
-					uni.showToast({icon:"none",title:"请填写收件人完整姓名"});
-					return;
-				}
-				if( !this.addrRequest.contact_shop ){
-					uni.showToast({icon:"none",title:"请填写店铺名称"});
-					return;
-				}
-				if( !this.addrRequest.contact_phone ){
-					uni.showToast({icon:"none",title:"请填写收件人手机号"});
-					return;
-				}
-				if( !this.addrRequest.contact_addr ){
-					uni.showToast({icon:"none",title:"请填写联系地址"});
-					return;
-				}
-				if( this.addrRequest.contact_addr.length < 3 ){
-					uni.showToast({icon:"none",title:"请填写可用联系地址"});
-					return;
-				}
-				// 请求状态
-				uni.showLoading({mask:true});
-				// 请求路径
-				var url 		= this.addrRequest.id ? 'api/custom_addr/edit' : 'api/custom_addr/add';
-				// 授权成功以后,调用绑定
-				this.$http.request(url,this.addrRequest,'post').then((re)=>{
-					// 关闭
-					uni.hideLoading();
-					// 成功的话
-					if( re.code != 'success' ){
-						// 跳转
-						uni.showToast({title: re.msg,icon:"none"});
-						return;
-					}
-					// 地址变动
-					this.getList();
-					// 显示下单弹出层
-					this.$refs.addrForm.close();
-				});
-			},
-			// 删除地址
-			removeAddr(index){
-				// 授权成功以后,调用绑定
-				this.$http.request('api/custom_addr/del',{id:this.addrList[index].id},'post').then((re)=>{
-					// 关闭
-					uni.hideLoading();
-					// 成功的话
-					if( re.code != 'success' ){
-						// 跳转
-						uni.showToast({title: re.msg,icon:"none"});
-						return;
-					}
-					// 成功删除该项
-					this.addrList.splice(index,1);
-					// 通知地址变更
-					if( this.AddrEmit ) uni.$emit('addr_list_change',{list:this.addrList});
-				});
-			},
-			// 设置默认
-			setDefault(index){
-				// 如果已经是默认状态
-				if( this.addrList[index].is_default ) return;
-				// 授权成功以后,调用绑定
-				this.$http.request('api/custom_addr/set_default',{id:this.addrList[index].id},'post').then((re)=>{
-					// 关闭
-					uni.hideLoading();
-					// 成功的话
-					if( re.code != 'success' ){
-						// 跳转
-						uni.showToast({title: re.msg,icon:"none"});
-						return;
-					}
-					// 更新其他的默认项
-					for (let i in this.addrList) {
-						this.addrList[i].is_default = 0;
-					}
-					// 成功修改值
-					this.addrList[index].is_default = 1;
-					// 通知地址变更
-					if( this.AddrEmit ) uni.$emit('addr_list_change',{list:this.addrList});
-				});
-			},
-		}
-	}
+import { getProvinces, getMyCity, getAreas } from "../../utils/city";
+export default {
+  data() {
+    return {
+      // 产品列表
+      addrList: [],
+      // 请求参数
+      requestParam: {
+        page: 1,
+        status: 0,
+      },
+      // 保存地址
+      addrRequest: {
+        id: 0,
+        contact_name: "",
+        contact_phone: "",
+        contact_province: "",
+        contact_city: "",
+        contact_area: "",
+        contact_addr: "",
+        contact_shop: "",
+        is_default: 0,
+      },
+      // 是否最后一页
+      isLast: false,
+      // 是否请求中
+      isReqing: false,
+      // 所在地区
+      cityArray: [[], [], []],
+      cityValue: [0, 0, 0],
+      // 自动弹出
+      autoShowForm: false,
+      // 异步通知
+      AddrEmit: false,
+    };
+  },
+  onLoad(param) {
+    this.AddrEmit = param.notify == "addr" ? true : false;
+    this.autoShowForm = param.type == "create" ? true : false;
+    // 获取列表
+    this.getList();
+  },
+  onReady() {
+    if (this.autoShowForm) {
+      var that = this;
+      // 500毫秒后自动弹出
+      setTimeout(function () {
+        that.openForm();
+      }, 500);
+    }
+  },
+  onShow() {
+    // 替换对应的数据
+    this.cityArray.splice(0, 1, getProvinces());
+    this.cityArray.splice(1, 1, getMyCity(this.cityValue[0]));
+    this.cityArray.splice(2, 1, getAreas(this.cityValue[0], this.cityValue[1]));
+    // 默认地址
+    this.addrRequest.contact_province = this.cityArray[0][this.cityValue[0]];
+    this.addrRequest.contact_city = this.cityArray[1][this.cityValue[1]];
+    this.addrRequest.contact_area = this.cityArray[2][this.cityValue[2]];
+  },
+  methods: {
+    // 获取列表
+    getList() {
+      // 登录提示
+      if (!this.$checkAccess.alterLogin()) return;
+      // 判断数据
+      this.$http.request("api/custom_addr/get_list").then((callback) => {
+        // 获取成功
+        if (callback.code == "success") {
+          this.addrList = callback.data;
+          // 通知地址变更
+          if (this.AddrEmit) uni.$emit("addr_list_change", { list: this.addrList });
+        }
+      });
+    },
+    // 打开弹窗
+    openForm(item) {
+      if (!item) {
+        this.addrRequest.id = 0;
+        this.addrRequest.contact_name = "";
+        this.addrRequest.contact_phone = "";
+        this.addrRequest.contact_shop = "";
+        this.addrRequest.contact_addr = "";
+        this.addrRequest.is_default = 0;
+      } else {
+        this.addrRequest = item;
+      }
+      // 显示下单弹出层
+      this.$refs.addrForm.open("bottom");
+    },
+    // 默认开关
+    defaultSwitch(e) {
+      this.addrRequest.is_default = e.detail.value ? 1 : 0;
+    },
+    // 弹出层
+    popupChange(e) {
+      // 禁止滚动穿透
+      this.show = e.show;
+    },
+    // 城市修改
+    cityChange(e) {
+      // 替换三个选项
+      this.cityValue.splice(e.detail.column, 1, e.detail.value);
+      // 下一级设置为0
+      if (e.detail.column == 0) {
+        this.cityValue.splice(1, 1, 0);
+        this.cityValue.splice(2, 1, 0);
+      }
+      if (e.detail.column == 1) {
+        this.cityValue.splice(2, 1, 0);
+      }
+      // 替换对应的数据
+      this.cityArray.splice(0, 1, getProvinces());
+      this.cityArray.splice(1, 1, getMyCity(this.cityValue[0]));
+      this.cityArray.splice(2, 1, getAreas(this.cityValue[0], this.cityValue[1]));
+    },
+    // 城市选择
+    cityFinish(e) {
+      this.addrRequest.contact_province = this.cityArray[0][this.cityValue[0]];
+      this.addrRequest.contact_city = this.cityArray[1][this.cityValue[1]];
+      this.addrRequest.contact_area = this.cityArray[2][this.cityValue[2]];
+    },
+    // 城市选中
+    cityFinish(e) {
+      this.addrRequest.contact_province = this.cityArray[0][this.cityValue[0]];
+      this.addrRequest.contact_city = this.cityArray[1][this.cityValue[1]];
+      this.addrRequest.contact_area = this.cityArray[2][this.cityValue[2]];
+    },
+    // 保存地址
+    saveAddr() {
+      // 判断姓名
+      if (!this.addrRequest.contact_name) {
+        uni.showToast({ icon: "none", title: "请填写收件人" });
+        return;
+      }
+      if (this.addrRequest.contact_name.length < 2) {
+        uni.showToast({ icon: "none", title: "请填写收件人完整姓名" });
+        return;
+      }
+      if (!this.addrRequest.contact_shop) {
+        uni.showToast({ icon: "none", title: "请填写店铺名称" });
+        return;
+      }
+      if (!this.addrRequest.contact_phone) {
+        uni.showToast({ icon: "none", title: "请填写收件人手机号" });
+        return;
+      }
+      if (!this.addrRequest.contact_addr) {
+        uni.showToast({ icon: "none", title: "请填写联系地址" });
+        return;
+      }
+      if (this.addrRequest.contact_addr.length < 3) {
+        uni.showToast({ icon: "none", title: "请填写可用联系地址" });
+        return;
+      }
+      // 请求状态
+      uni.showLoading({ mask: true });
+      // 请求路径
+      var url = this.addrRequest.id ? "api/custom_addr/edit" : "api/custom_addr/add";
+      // 授权成功以后,调用绑定
+      this.$http.request(url, this.addrRequest, "post").then((re) => {
+        // 关闭
+        uni.hideLoading();
+        // 成功的话
+        if (re.code != "success") {
+          // 跳转
+          uni.showToast({ title: re.msg, icon: "none" });
+          return;
+        }
+        // 地址变动
+        this.getList();
+        // 显示下单弹出层
+        this.$refs.addrForm.close();
+      });
+    },
+    // 删除地址
+    removeAddr(index) {
+      // 授权成功以后,调用绑定
+      this.$http.request("api/custom_addr/del", { id: this.addrList[index].id }, "post").then((re) => {
+        // 关闭
+        uni.hideLoading();
+        // 成功的话
+        if (re.code != "success") {
+          // 跳转
+          uni.showToast({ title: re.msg, icon: "none" });
+          return;
+        }
+        // 成功删除该项
+        this.addrList.splice(index, 1);
+        // 通知地址变更
+        if (this.AddrEmit) uni.$emit("addr_list_change", { list: this.addrList });
+      });
+    },
+    // 设置默认
+    setDefault(index) {
+      // 如果已经是默认状态
+      if (this.addrList[index].is_default) return;
+      // 授权成功以后,调用绑定
+      this.$http.request("api/custom_addr/set_default", { id: this.addrList[index].id }, "post").then((re) => {
+        // 关闭
+        uni.hideLoading();
+        // 成功的话
+        if (re.code != "success") {
+          // 跳转
+          uni.showToast({ title: re.msg, icon: "none" });
+          return;
+        }
+        // 更新其他的默认项
+        for (let i in this.addrList) {
+          this.addrList[i].is_default = 0;
+        }
+        // 成功修改值
+        this.addrList[index].is_default = 1;
+        // 通知地址变更
+        if (this.AddrEmit) uni.$emit("addr_list_change", { list: this.addrList });
+      });
+    },
+  },
+};
 </script>
 
 <style lang="less">
-	.addr_list{
-		width: 730rpx;
-		display: block;
-		overflow: hidden;
-		margin: 0rpx auto;
-		.addr_item{
-			display: block;
-			font-size: 24rpx;
-			overflow: hidden;
-			line-height: 40rpx;
-			padding: 15rpx 10rpx;
-			border-radius: 15rpx;
-			padding-bottom: 0rpx;
-			margin-bottom: 10rpx;
-			background-color: #FFFFFF;
-			.contact_user{
-				display: block;
-				font-size: 24rpx;
-				line-height: 50rpx;
-				.contact_name{
-					font-size: 26rpx;
-					font-weight: bold;
-					margin-right: 16rpx;
-				}
-				.contact_shop{
-					float: right;
-				}
-			}
-			.contact_addr{
-				display: block;
-				font-size: 24rpx;
-				line-height: 30rpx;
-				padding: 10rpx 5rpx;
-				border-bottom: 2rpx solid #dddddd;
-			}
-			.contact_handler{
-				height: 60rpx;
-				display: block;
-				line-height: 60rpx;
-				font-size: 20rpx;
-				.radio_label{
-					float: left;
-					height: 60rpx;
-					line-height: 60rpx;
-					.radio_icon{
-						width: 40rpx;
-						height: 40rpx;
-						vertical-align: middle;
-					}
-					.radioed_text{
-						color: #E03519;
-					}
-				}
-				.addr_right_btn{
-					float: right;
-					height: 40rpx;
-					display: block;
-					line-height: 40rpx;
-					padding: 10rpx 35rpx;
-				}
-			}
-		}
-	}
-	.create_box{
-		left: 0rpx;
-		width: 750rpx;
-		height: 140rpx;
-		display: block;
-		position: fixed;
-		bottom: var(--window-bottom);
-		.create_addr{
-			width: 700rpx;
-			height: 80rpx;
-			display: block;
-			color: #FFFFFF;
-			font-size: 30rpx;
-			overflow: hidden;
-			line-height: 80rpx;
-			padding: 0rpx 0rpx;
-			text-align: center;
-			margin: 0rpx auto;
-			margin-top: 20rpx;
-			border-radius: 40rpx;
-			background-color: #E03519;
-		}
-	}
-	.popup{
-		.info_form{
-			display: block;
-			overflow: hidden;
-			padding: 20rpx 0rpx;
-			padding-top: 80rpx;
-			background: #FFFFFF;
-			.form_group{
-				display: block;
-				overflow: hidden;
-				line-height: 60rpx;
-				padding: 20rpx 35rpx;
-				.group_title{
-					float: left;
-					width: 160rpx;
-					display: block;
-					overflow: hidden;
-					font-size: 30rpx;
-					margin-right: 20rpx;
-				}
-				.group_box{
-					float: left;
-					width: 480rpx;
-					display: block;
-					.form_ctrl{
-						height: 56rpx;
-						font-size: 24rpx;
-						padding: 0rpx 20rpx;
-						line-height: 56rpx;;
-						border: 2rpx solid #DDDDDD;
-					}
-					.area_text{
-						width: 446rpx;
-						font-size: 20rpx;
-						overflow: hidden;
-						white-space: nowrap;
-						text-overflow: ellipsis;
-					}
-					.group_image{
-						width: 200rpx;
-						height: 200rpx;
-					}
-					.choose_image{
-						display: block;
-						width: 200rpx;
-						height: 200rpx;
-						font-size: 38rpx;
-						text-align: center;
-						line-height: 200rpx;
-						border: 2rpx solid #DDDDDD;
-					}
-				}
-			}
-			.submit_btn{
-				width: 700rpx;
-				height: 80rpx;
-				display: block;
-				color: #FFFFFF;
-				font-size: 30rpx;
-				overflow: hidden;
-				line-height: 80rpx;
-				padding: 0rpx 0rpx;
-				text-align: center;
-				margin: 20rpx auto;
-				margin-top: 40rpx;
-				border-radius: 40rpx;
-				background-color: #E03519;
-			}
-		}
-	}
-</style>
+.addr_list {
+  width: 730rpx;
+  display: block;
+  overflow: hidden;
+  margin: 0rpx auto;
+  .addr_item {
+    display: block;
+    font-size: 24rpx;
+    overflow: hidden;
+    line-height: 40rpx;
+    padding: 15rpx 10rpx;
+    border-radius: 15rpx;
+    padding-bottom: 0rpx;
+    margin-bottom: 10rpx;
+    background-color: #ffffff;
+    .contact_user {
+      display: block;
+      font-size: 24rpx;
+      line-height: 50rpx;
+      .contact_name {
+        font-size: 26rpx;
+        font-weight: bold;
+        margin-right: 16rpx;
+      }
+      .contact_shop {
+        float: right;
+      }
+    }
+    .contact_addr {
+      display: block;
+      font-size: 24rpx;
+      line-height: 30rpx;
+      padding: 10rpx 5rpx;
+      border-bottom: 2rpx solid #dddddd;
+    }
+    .contact_handler {
+      height: 60rpx;
+      display: block;
+      line-height: 60rpx;
+      font-size: 20rpx;
+      .radio_label {
+        float: left;
+        height: 60rpx;
+        line-height: 60rpx;
+        .radio_icon {
+          width: 40rpx;
+          height: 40rpx;
+          vertical-align: middle;
+        }
+        .radioed_text {
+          color: #e03519;
+        }
+      }
+      .addr_right_btn {
+        float: right;
+        height: 40rpx;
+        display: block;
+        line-height: 40rpx;
+        padding: 10rpx 35rpx;
+      }
+    }
+  }
+}
+.create_box {
+  left: 0rpx;
+  width: 750rpx;
+  height: 140rpx;
+  display: block;
+  position: fixed;
+  bottom: var(--window-bottom);
+  .create_addr {
+    width: 700rpx;
+    height: 80rpx;
+    display: block;
+    color: #ffffff;
+    font-size: 30rpx;
+    overflow: hidden;
+    line-height: 80rpx;
+    padding: 0rpx 0rpx;
+    text-align: center;
+    margin: 0rpx auto;
+    margin-top: 20rpx;
+    border-radius: 40rpx;
+    background-color: #e03519;
+  }
+}
+.popup {
+  .info_form {
+    display: block;
+    overflow: hidden;
+    padding: 20rpx 0rpx;
+    padding-top: 80rpx;
+    background: #ffffff;
+    .form_group {
+      display: block;
+      overflow: hidden;
+      line-height: 60rpx;
+      padding: 20rpx 35rpx;
+      .group_title {
+        float: left;
+        width: 160rpx;
+        display: block;
+        overflow: hidden;
+        font-size: 30rpx;
+        margin-right: 20rpx;
+      }
+      .group_box {
+        float: left;
+        width: 480rpx;
+        display: block;
+        .form_ctrl {
+          height: 56rpx;
+          font-size: 28rpx;
+          padding: 0rpx 20rpx;
+          line-height: 56rpx;
+          border: 2rpx solid #dddddd;
+        }
+        .area_text {
+          width: 446rpx;
+          font-size: 20rpx;
+          overflow: hidden;
+          white-space: nowrap;
+          text-overflow: ellipsis;
+        }
+        .group_image {
+          width: 200rpx;
+          height: 200rpx;
+        }
+        .choose_image {
+          display: block;
+          width: 200rpx;
+          height: 200rpx;
+          font-size: 38rpx;
+          text-align: center;
+          line-height: 200rpx;
+          border: 2rpx solid #dddddd;
+        }
+      }
+    }
+    .submit_btn {
+      width: 700rpx;
+      height: 80rpx;
+      display: block;
+      color: #ffffff;
+      font-size: 30rpx;
+      overflow: hidden;
+      line-height: 80rpx;
+      padding: 0rpx 0rpx;
+      text-align: center;
+      margin: 20rpx auto;
+      margin-top: 40rpx;
+      border-radius: 40rpx;
+      background-color: #e03519;
+    }
+  }
+}
+</style>

+ 485 - 0
pages/addr/order.vue

@@ -0,0 +1,485 @@
+<template>
+  <view>
+    <view class="to_bottom" v-if="!addrList.length"> -----还没有地址啦-----</view>
+    <view class="addr_list">
+      <view class="addr_item" v-for="(item, index) in addrList" :key="index">
+        <view class="contact_user">
+          <text class="contact_name">{{ item.contact_name }}</text>
+          <text class="contact_phone">{{ item.contact_phone }}</text>
+          <text class="contact_shop">{{ item.contact_shop }}</text>
+        </view>
+        <view class="contact_addr"> {{ item.contact_area }} {{ item.contact_school }} {{ item.contact_grade }} {{ item.contact_class }} </view>
+        <view class="contact_handler">
+          <view class="radio_label" @click="setDefault(index)">
+            <image class="radio_icon" :src="item.is_default ? '../../static/icon/radioed.png' : '../../static/icon/radio.png'"></image>
+            <text :class="item.is_default ? 'radioed_text' : ''">{{ item.is_default ? "已默认" : "设为默认" }}</text>
+          </view>
+          <view class="addr_right_btn" @click="removeAddr(index)"> 删除 </view>
+          <view class="addr_right_btn" @click="openForm(item)"> 编辑 </view>
+        </view>
+      </view>
+    </view>
+    <view class="create_box">
+      <button class="create_addr" @click="openForm()">新建收货地址</button>
+    </view>
+    <view class="to_bottom" v-if="isLast"> -----到底啦-----</view>
+    <uni-popup ref="addrForm" type="bottom" class="popup" background-color="#FFFFFF" @change="popupChange">
+      <view class="contact_addr_form">
+        <!-- 地区代表表单 -->
+        <form class="info_form">
+          <view class="form_group">
+            <view class="group_title">姓名:</view>
+            <view class="group_box">
+              <input type="text" class="form_ctrl" placeholder="请输入学生姓名" maxlength="20" required="" v-model="addrRequest.contact_name" />
+            </view>
+          </view>
+          <view class="form_group">
+            <view class="group_title">手机号:</view>
+            <view class="group_box">
+              <input type="text" class="form_ctrl" placeholder="请输入家长手机号" maxlength="11" required="" v-model="addrRequest.contact_phone" />
+            </view>
+          </view>
+          <view class="form_group">
+            <view class="group_title">区域:</view>
+            <view class="group_box">
+              <picker mode="multiSelector" class="form_ctrl" :range="cityArray" @columnchange="cityChange" @change="cityFinish">
+                <view class="area_text">
+                  <text v-if="addrRequest.contact_area">{{ addrRequest.contact_area }}</text>
+                  <text v-if="addrRequest.contact_school">/{{ addrRequest.contact_school }}</text>
+                </view>
+              </picker>
+            </view>
+          </view>
+          <view class="form_group">
+            <view class="group_title">年级:</view>
+            <view class="group_box">
+              <!-- <input type="text" class="form_ctrl" placeholder="请输入详细地址:街道/小区/门牌号" maxlength="64" required="" v-model="addrRequest.contact_addr" /> -->
+              <picker class="form_ctrl" :range="ageArray" @change="bindAgeChange">
+                <view class="area_text">
+                  <text>{{ addrRequest.contact_grade == "" ? "请选择年级" : addrRequest.contact_grade }}</text>
+                </view>
+              </picker>
+            </view>
+          </view>
+          <view class="form_group">
+            <view class="group_title">班级:</view>
+            <view class="group_box">
+              <picker class="form_ctrl" :range="classArray" @change="bindClassChange">
+                <view class="area_text">
+                  <text>{{ addrRequest.contact_class == "" ? "请选择班级" : addrRequest.contact_class }}</text>
+                </view>
+              </picker>
+            </view>
+          </view>
+          <view class="form_group">
+            <view class="group_title">设为默认</view>
+            <view class="group_box">
+              <switch color="#E03519" style="transform: scale(0.6); float: right" @change="defaultSwitch" :checked="addrRequest.is_default ? true : false" />
+            </view>
+          </view>
+          <button class="submit_btn" @click="saveAddr">保存地址</button>
+        </form>
+      </view>
+    </uni-popup>
+  </view>
+</template>
+
+<script>
+import { getProvinces, getMyCity, getAreas } from "../../utils/city";
+export default {
+  data() {
+    return {
+      // 产品列表
+      addrList: [],
+      // 请求参数
+      requestParam: {
+        page: 1,
+        status: 0,
+      },
+      // 保存地址
+      addrRequest: {
+        id: 0,
+        contact_name: "",
+        contact_phone: "",
+        contact_school: "",
+        contact_area: "",
+        contact_addr: "",
+        contact_shop: "",
+        contact_grade: "",
+        contact_class: "",
+        is_default: 0,
+      },
+      // 是否最后一页
+      isLast: false,
+      // 是否请求中
+      isReqing: false,
+      // 所在地区
+      cityArray: [[], []],
+      cityValue: [0, 0],
+      // 自动弹出
+      autoShowForm: false,
+      // 异步通知
+      AddrEmit: false,
+      ageArray: [],
+      classArray: [],
+    };
+  },
+  onLoad(param) {
+    this.AddrEmit = param.notify == "addr" ? true : false;
+    this.autoShowForm = param.type == "create" ? true : false;
+    // 获取列表
+    this.getList();
+    //获取学院
+    this.getSchool();
+  },
+  onReady() {
+    if (this.autoShowForm) {
+      var that = this;
+      // 500毫秒后自动弹出
+      setTimeout(function () {
+        that.openForm();
+      }, 500);
+    }
+  },
+  onShow() {},
+  methods: {
+    getArea(list) {
+      var provinces = [];
+      for (var i = 0; i < list.length; i++) {
+        provinces.push(list[i].area_name);
+      }
+      return provinces;
+    },
+    getSchoolList(list, provinceIndex) {
+      var citys = [];
+
+      for (var i = 0; i < list[provinceIndex].school_list.length; i++) {
+        citys.push(list[provinceIndex].school_list[i].name);
+      }
+
+      return citys;
+    },
+    getSchool() {
+      // 获取学院
+      this.$http.request("api/school/get_list").then((callback) => {
+        // console.log(callback);
+        if (callback.code == "success") {
+          this.ageArray = callback.data.grade_list;
+          this.classArray = callback.data.class_list;
+          this.area_list = callback.data.area_list;
+          // 替换对应的数据
+          this.cityArray.splice(0, 1, this.getArea(callback.data.area_list));
+          this.cityArray.splice(1, 1, this.getSchoolList(callback.data.area_list, this.cityValue[0]));
+          // 默认地址
+          this.addrRequest.contact_area = this.cityArray[0][this.cityValue[0]];
+          this.addrRequest.contact_school = this.cityArray[1][this.cityValue[1]];
+          this.addrRequest.contact_grade = callback.data.grade_list[0];
+          this.addrRequest.contact_class = callback.data.class_list[0];
+        }
+      });
+    },
+    // 获取列表
+    getList() {
+      // 登录提示
+      if (!this.$checkAccess.alterLogin()) return;
+      // 判断数据
+      this.$http.request("api/student_addr/get_list").then((callback) => {
+        // 获取成功
+        if (callback.code == "success") {
+          this.addrList = callback.data;
+          // 通知地址变更
+          if (this.AddrEmit) uni.$emit("addr_list_change", { list: this.addrList });
+        }
+      });
+    },
+    // 打开弹窗
+    openForm(item) {
+      if (!item) {
+        this.addrRequest.id = 0;
+        this.addrRequest.contact_name = "";
+        this.addrRequest.contact_phone = "";
+        this.addrRequest.contact_shop = "";
+        this.addrRequest.contact_addr = "";
+        this.addrRequest.is_default = 0;
+      } else {
+        const _cloneItem = JSON.parse(JSON.stringify(item));
+        this.addrRequest = _cloneItem;
+      }
+      // 显示下单弹出层
+      this.$refs.addrForm.open("bottom");
+    },
+    // 默认开关
+    defaultSwitch(e) {
+      this.addrRequest.is_default = e.detail.value ? 1 : 0;
+    },
+    // 弹出层
+    popupChange(e) {
+      // 禁止滚动穿透
+      this.show = e.show;
+    },
+    // 城市修改
+    cityChange(e) {
+      // 替换三个选项
+      this.cityValue.splice(e.detail.column, 1, e.detail.value);
+      // 下一级设置为0
+      if (e.detail.column == 0) {
+        this.cityValue.splice(1, 1, 0);
+        this.cityValue.splice(2, 1, 0);
+      }
+      if (e.detail.column == 1) {
+        this.cityValue.splice(2, 1, 0);
+      }
+      // 替换对应的数据
+      this.cityArray.splice(0, 1, this.getArea(this.area_list));
+      this.cityArray.splice(1, 1, this.getSchoolList(this.area_list, this.cityValue[0]));
+    },
+    // 城市选择
+    cityFinish(e) {
+      this.addrRequest.contact_area = this.cityArray[0][this.cityValue[0]];
+      this.addrRequest.contact_school = this.cityArray[1][this.cityValue[1]];
+    },
+    bindAgeChange(e) {
+      this.addrRequest.contact_grade = this.ageArray[e.detail.value];
+    },
+    bindClassChange(e) {
+      this.addrRequest.contact_class = this.classArray[e.detail.value];
+    },
+    // 保存地址
+    saveAddr() {
+      // 判断姓名
+      if (!this.addrRequest.contact_name) {
+        uni.showToast({ icon: "none", title: "请填写学生姓名" });
+        return;
+      }
+      if (this.addrRequest.contact_name.length < 2) {
+        uni.showToast({ icon: "none", title: "请填写学生完整姓名" });
+        return;
+      }
+      if (!this.addrRequest.contact_phone) {
+        uni.showToast({ icon: "none", title: "请填写收件人手机号" });
+        return;
+      }
+      // 请求状态
+      uni.showLoading({ mask: true });
+      // 请求路径
+      var url = this.addrRequest.id ? "api/student_addr/edit" : "api/student_addr/add";
+      // 授权成功以后,调用绑定
+      this.$http.request(url, this.addrRequest, "post").then((re) => {
+        // 关闭
+        uni.hideLoading();
+        // 成功的话
+        if (re.code != "success") {
+          // 跳转
+          uni.showToast({ title: re.msg, icon: "none" });
+          return;
+        }
+        // 地址变动
+        this.getList();
+        // 显示下单弹出层
+        this.$refs.addrForm.close();
+      });
+    },
+    // 删除地址
+    removeAddr(index) {
+      // 授权成功以后,调用绑定
+      this.$http.request("api/student_addr/del", { id: this.addrList[index].id }, "post").then((re) => {
+        // 关闭
+        uni.hideLoading();
+        // 成功的话
+        if (re.code != "success") {
+          // 跳转
+          uni.showToast({ title: re.msg, icon: "none" });
+          return;
+        }
+        // 成功删除该项
+        this.addrList.splice(index, 1);
+        // 通知地址变更
+        if (this.AddrEmit) uni.$emit("addr_list_change", { list: this.addrList });
+      });
+    },
+    // 设置默认
+    setDefault(index) {
+      // 如果已经是默认状态
+      if (this.addrList[index].is_default) return;
+      // 授权成功以后,调用绑定
+      this.$http.request("api/student_addr/set_default", { id: this.addrList[index].id }, "post").then((re) => {
+        // 关闭
+        uni.hideLoading();
+        // 成功的话
+        if (re.code != "success") {
+          // 跳转
+          uni.showToast({ title: re.msg, icon: "none" });
+          return;
+        }
+        // 更新其他的默认项
+        for (let i in this.addrList) {
+          this.addrList[i].is_default = 0;
+        }
+        // 成功修改值
+        this.addrList[index].is_default = 1;
+        // 通知地址变更
+        if (this.AddrEmit) uni.$emit("addr_list_change", { list: this.addrList });
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less">
+.addr_list {
+  width: 730rpx;
+  display: block;
+  overflow: hidden;
+  margin: 0rpx auto;
+  .addr_item {
+    display: block;
+    font-size: 24rpx;
+    overflow: hidden;
+    line-height: 40rpx;
+    padding: 15rpx 10rpx;
+    border-radius: 15rpx;
+    padding-bottom: 0rpx;
+    margin-bottom: 10rpx;
+    background-color: #ffffff;
+    .contact_user {
+      display: block;
+      font-size: 24rpx;
+      line-height: 50rpx;
+      .contact_name {
+        font-size: 26rpx;
+        font-weight: bold;
+        margin-right: 16rpx;
+      }
+      .contact_shop {
+        float: right;
+      }
+    }
+    .contact_addr {
+      display: block;
+      font-size: 24rpx;
+      line-height: 30rpx;
+      padding: 10rpx 5rpx;
+      border-bottom: 2rpx solid #dddddd;
+    }
+    .contact_handler {
+      height: 60rpx;
+      display: block;
+      line-height: 60rpx;
+      font-size: 20rpx;
+      .radio_label {
+        float: left;
+        height: 60rpx;
+        line-height: 60rpx;
+        .radio_icon {
+          width: 40rpx;
+          height: 40rpx;
+          vertical-align: middle;
+        }
+        .radioed_text {
+          color: #e03519;
+        }
+      }
+      .addr_right_btn {
+        float: right;
+        height: 40rpx;
+        display: block;
+        line-height: 40rpx;
+        padding: 10rpx 35rpx;
+      }
+    }
+  }
+}
+.create_box {
+  left: 0rpx;
+  width: 750rpx;
+  height: 140rpx;
+  display: block;
+  position: fixed;
+  bottom: var(--window-bottom);
+  .create_addr {
+    width: 700rpx;
+    height: 80rpx;
+    display: block;
+    color: #ffffff;
+    font-size: 30rpx;
+    overflow: hidden;
+    line-height: 80rpx;
+    padding: 0rpx 0rpx;
+    text-align: center;
+    margin: 0rpx auto;
+    margin-top: 20rpx;
+    border-radius: 40rpx;
+    background-color: #e03519;
+  }
+}
+.popup {
+  .info_form {
+    display: block;
+    overflow: hidden;
+    padding: 20rpx 0rpx;
+    padding-top: 80rpx;
+    background: #ffffff;
+    .form_group {
+      display: block;
+      overflow: hidden;
+      line-height: 60rpx;
+      padding: 20rpx 35rpx;
+      .group_title {
+        float: left;
+        width: 160rpx;
+        display: block;
+        overflow: hidden;
+        font-size: 30rpx;
+        margin-right: 20rpx;
+      }
+      .group_box {
+        float: left;
+        width: 480rpx;
+        display: block;
+        .form_ctrl {
+          height: 56rpx;
+          font-size: 28rpx;
+          padding: 0rpx 20rpx;
+          line-height: 56rpx;
+          border: 2rpx solid #dddddd;
+        }
+        .area_text {
+          width: 446rpx;
+          font-size: 28rpx;
+          overflow: hidden;
+          white-space: nowrap;
+          text-overflow: ellipsis;
+        }
+        .group_image {
+          width: 200rpx;
+          height: 200rpx;
+        }
+        .choose_image {
+          display: block;
+          width: 200rpx;
+          height: 200rpx;
+          font-size: 38rpx;
+          text-align: center;
+          line-height: 200rpx;
+          border: 2rpx solid #dddddd;
+        }
+      }
+    }
+    .submit_btn {
+      width: 700rpx;
+      height: 80rpx;
+      display: block;
+      color: #ffffff;
+      font-size: 30rpx;
+      overflow: hidden;
+      line-height: 80rpx;
+      padding: 0rpx 0rpx;
+      text-align: center;
+      margin: 20rpx auto;
+      margin-top: 40rpx;
+      border-radius: 40rpx;
+      background-color: #e03519;
+    }
+  }
+}
+</style>

+ 2 - 2
pages/car/index.vue

@@ -17,7 +17,7 @@
           <view v-if="item.promo_title" class="promo_title">{{item.promo_title}}</view>
 					<navigator :url="'/pages/product/index?product_id='+item.product_id"  class="car_price">
 						<text class="price">¥{{item.price}}</text>
-						<text class="market_price">¥{{item.market_price}}</text>
+						<!-- <text class="market_price">¥{{item.market_price}}</text> -->
 					</navigator>
 				</view>
 				<view class="box_right">
@@ -77,7 +77,7 @@
 			let shareList 	= getApp().globalData.shareList;
 			// 获取分享信息
 			let shareObj	= {
-								title: '药优惠 得积分 兑豪礼',
+								title: '学生征订',
 								path: '/pages/index/index',
 								imageUrl:'',
 							};

+ 913 - 937
pages/car/order.vue

@@ -1,947 +1,923 @@
 <template>
-	<view>
-		<view class="custom_addr" @click="showAddrPopup()">
-			<view class="contact_user">
-				<text class="contact_none" v-if="!checkedAddr.id">请选择收货地址</text>
-				<text class="contact_name">{{checkedAddr.contact_name}}</text>
-				<text class="contact_phone">{{checkedAddr.contact_phone}}</text>
-				<text class="contact_more"> &gt;</text>
-				<text class="contact_shop">{{checkedAddr.contact_shop}}</text>
-			</view>
-			<view class="contact_addr">
-				{{checkedAddr.contact_province}} {{checkedAddr.contact_city}} {{checkedAddr.contact_area}}
-				{{checkedAddr.contact_addr}}
-			</view>
-		</view>
-		<view class="car_list">
-			<view class="car_item" v-for="(item,index) in cartList" :key="index">
-				<view class="box_left">
-					<image class="car_image" :src="item.thumb" mode=""></image>
-				</view>
-				<view class="box_center">
-					<view class="car_name">{{item.name}}</view>
-					<view class="car_spec">{{item.spec}}</view>
-					<view v-if="item.promo_title" class="promo_title">{{item.promo_title}}</view>
-					<view class="car_price">
-						<text class="price">¥{{item.price}}</text>
-					</view>
-				</view>
-				<view class="box_right">
-					<view class="buy_num_box">
-						<view class="buy_num">共{{item.buy_num}}件</view>
-					</view>
-				</view>
-			</view>
-			<view class="car_item" v-for="(item,index) in promoRebateList" :key="index">
-				<view class="box_left">
-					<image class="car_image" :src="item.thumb" mode=""></image>
-				</view>
-				<view class="box_center">
-					<view class="car_name"><text v-if="item.promo_rebate_id">【赠品】</text>{{item.name}}</view>
-					<view class="car_spec">{{item.spec}}</view>
-					<view class="car_price">
-						<text class="price">¥{{item.price}}</text>
-					</view>
-				</view>
-				<view class="box_right">
-					<view class="buy_num_box">
-						<view class="buy_num">共{{item.buy_num}}件</view>
-					</view>
-				</view>
-			</view>
-		</view>
-		<view>
-			<view class="to_select_coupon" v-if="couponList.length" @click="popupCoupon()">
-				<text>优惠券</text>
-				<view class="coupon_deduction">{{couponUsed}}</view>
-			</view>
-			<view class="to_select_coupon" v-if="reduction > 0">
-				<text>满减</text>
-				<view class="coupon_deduction">-{{reduction}}</view>
-			</view>
-			<view class="to_select_coupon" v-if="discount > 0">
-				<text>商品折扣</text>
-				<view class="coupon_deduction">-{{discount}}</view>
-			</view>
-		</view>
-		<view class="bottom_box">
-			<view class="price_box">
-				合计:<text class="price_total">¥{{priceTotal}}</text>
-			</view>
-			<button class="to_order" @click="createOrder()" data-eventsync="true">提交订单</button>
-		</view>
-		<uni-popup ref="popup" type="bottom" class="popup" background-color="#FFFFFF" @touchmove.stop.prevent="()=>{}">
-			<view class="coupon_list">
-				<view class="coupon_item" v-for="(item,index) in couponList" :key="index" @click="checkedCoupon(index)">
-					<view class="box_left">
-						<view class="rebate" v-if="item.rebate_type == 1"> ¥{{item.rebate}}</view>
-						<view class="rebate" v-if="item.rebate_type == 2"> 打 {{item.rebate}} 折</view>
-						<view class="rebate" v-if="item.rebate_type == 3">
-							赠
-							<text v-if="item.rebate_scope.length"> {{item.rebate_scope[0].product_name}} </text>
-						</view>
-						<view class="std_pay"> 满{{item.std_pay}}</view>
-					</view>
-					<view class="box_right">
-						<view class="coupon_title">
-							<view class="coupon_name" v-if="item.rebate_type == 1">满减券</view>
-							<view class="coupon_name" v-if="item.rebate_type == 2">折扣券</view>
-							<view class="coupon_name" v-if="item.rebate_type == 3">赠品券</view>
-						</view>
-						<view class="product_scope">
-							<text class="" v-if="item.type_id == 1">限定商品可用</text>
-							<text class="" v-if="item.type_id == 2">全场可用</text>
-							<view class="check_label">
-								<view class="isstd" v-if="!item.is_std">不可用</view>
-								<image class="checkbox" v-if="item.is_std"
-									:src="item.checked?'../../static/icon/checked.png':'../../static/icon/checkbox.png'">
-								</image>
-							</view>
-						</view>
-						<view class="coupon_info">
-							<view class="coupon_exp">{{item.exp_time}} 到期</view>
-						</view>
-					</view>
-				</view>
-			</view>
-		</uni-popup>
-		<uni-popup ref="addrPopup" type="bottom" class="popup" background-color="#FFFFFF">
-			<view class="popup_title">收货地址 <navigator url="/pages/addr/index?notify=addr" class="to_addr_page">管理
-				</navigator>
-			</view>
-			<view class="addr_list">
-				<view class="addr_item" v-for="(item,index) in addrList" :key="index" @click="checkedAddrItem(item)">
-					<view class="radio_label">
-						<image class="radio_icon"
-							:src="item.id == checkedAddr.id? '../../static/icon/radioed.png' : '../../static/icon/radio.png'">
-						</image>
-					</view>
-					<view class="contact_user">
-						<text class="contact_name">{{item.contact_name}}</text>
-						<text class="contact_phone">{{item.contact_phone}}</text>
-						<text class="contact_default" v-if="item.is_default">默认</text>
-					</view>
-					<view class="contact_addr">
-						{{item.contact_province}} {{item.contact_city}} {{item.contact_area}} {{item.contact_addr}}
-					</view>
-				</view>
-			</view>
-			<view class="create_box">
-				<navigator url="/pages/addr/index?notify=addr&type=create" class="create_addr">新建收货地址</navigator>
-			</view>
-		</uni-popup>
-	</view>
+  <view>
+    <view class="custom_addr" @click="showAddrPopup()">
+      <view class="contact_user">
+        <text class="contact_none" v-if="!checkedAddr.id">请选择收货地址</text>
+        <text class="contact_name">{{ checkedAddr.contact_name }}</text>
+        <text class="contact_phone">{{ checkedAddr.contact_phone }}</text>
+        <text class="contact_more"> &gt;</text>
+        <text class="contact_shop">{{ checkedAddr.contact_shop }}</text>
+      </view>
+      <view class="contact_addr"> {{ checkedAddr.contact_area }} {{ checkedAddr.contact_school }} {{ checkedAddr.contact_grade }} {{ checkedAddr.contact_class }} </view>
+    </view>
+    <view class="car_list">
+      <view class="car_item" v-for="(item, index) in cartList" :key="index">
+        <view class="box_left">
+          <image class="car_image" :src="item.thumb" mode=""></image>
+        </view>
+        <view class="box_center">
+          <view class="car_name">{{ item.name }}</view>
+          <view class="car_spec">{{ item.spec }}</view>
+          <view v-if="item.promo_title" class="promo_title">{{ item.promo_title }}</view>
+          <view class="car_price">
+            <text class="price">¥{{ item.price }}</text>
+          </view>
+        </view>
+        <view class="box_right">
+          <view class="buy_num_box">
+            <view class="buy_num">共{{ item.buy_num }}件</view>
+          </view>
+        </view>
+      </view>
+      <view class="car_item" v-for="(item, index) in promoRebateList" :key="index">
+        <view class="box_left">
+          <image class="car_image" :src="item.thumb" mode=""></image>
+        </view>
+        <view class="box_center">
+          <view class="car_name"><text v-if="item.promo_rebate_id">【赠品】</text>{{ item.name }}</view>
+          <view class="car_spec">{{ item.spec }}</view>
+          <view class="car_price">
+            <text class="price">¥{{ item.price }}</text>
+          </view>
+        </view>
+        <view class="box_right">
+          <view class="buy_num_box">
+            <view class="buy_num">共{{ item.buy_num }}件</view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view>
+      <view class="to_select_coupon" v-if="couponList.length" @click="popupCoupon()">
+        <text>优惠券</text>
+        <view class="coupon_deduction">{{ couponUsed }}</view>
+      </view>
+      <view class="to_select_coupon" v-if="reduction > 0">
+        <text>满减</text>
+        <view class="coupon_deduction">-{{ reduction }}</view>
+      </view>
+      <view class="to_select_coupon" v-if="discount > 0">
+        <text>商品折扣</text>
+        <view class="coupon_deduction">-{{ discount }}</view>
+      </view>
+    </view>
+    <view class="bottom_box">
+      <view class="price_box">
+        合计:<text class="price_total">¥{{ priceTotal }}</text>
+      </view>
+      <button class="to_order" @click="createOrder()" data-eventsync="true">提交订单</button>
+    </view>
+    <uni-popup ref="popup" type="bottom" class="popup" background-color="#FFFFFF" @touchmove.stop.prevent="() => {}">
+      <view class="coupon_list">
+        <view class="coupon_item" v-for="(item, index) in couponList" :key="index" @click="checkedCoupon(index)">
+          <view class="box_left">
+            <view class="rebate" v-if="item.rebate_type == 1"> ¥{{ item.rebate }}</view>
+            <view class="rebate" v-if="item.rebate_type == 2"> 打 {{ item.rebate }} 折</view>
+            <view class="rebate" v-if="item.rebate_type == 3">
+              赠
+              <text v-if="item.rebate_scope.length"> {{ item.rebate_scope[0].product_name }} </text>
+            </view>
+            <view class="std_pay"> 满{{ item.std_pay }}</view>
+          </view>
+          <view class="box_right">
+            <view class="coupon_title">
+              <view class="coupon_name" v-if="item.rebate_type == 1">满减券</view>
+              <view class="coupon_name" v-if="item.rebate_type == 2">折扣券</view>
+              <view class="coupon_name" v-if="item.rebate_type == 3">赠品券</view>
+            </view>
+            <view class="product_scope">
+              <text class="" v-if="item.type_id == 1">限定商品可用</text>
+              <text class="" v-if="item.type_id == 2">全场可用</text>
+              <view class="check_label">
+                <view class="isstd" v-if="!item.is_std">不可用</view>
+                <image class="checkbox" v-if="item.is_std" :src="item.checked ? '../../static/icon/checked.png' : '../../static/icon/checkbox.png'"> </image>
+              </view>
+            </view>
+            <view class="coupon_info">
+              <view class="coupon_exp">{{ item.exp_time }} 到期</view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </uni-popup>
+    <uni-popup ref="addrPopup" type="bottom" class="popup" background-color="#FFFFFF">
+      <view class="popup_title">收货地址 <navigator url="/pages/addr/order?notify=addr" class="to_addr_page">管理 </navigator> </view>
+      <view class="addr_list">
+        <view class="addr_item" v-for="(item, index) in addrList" :key="index" @click="checkedAddrItem(item)">
+          <view class="radio_label">
+            <image class="radio_icon" :src="item.id == checkedAddr.id ? '../../static/icon/radioed.png' : '../../static/icon/radio.png'"> </image>
+          </view>
+          <view class="contact_user">
+            <text class="contact_name">{{ item.contact_name }}</text>
+            <text class="contact_phone">{{ item.contact_phone }}</text>
+            <text class="contact_default" v-if="item.is_default">默认</text>
+          </view>
+          <view class="contact_addr"> {{ item.contact_area }} {{ item.contact_school }} {{ item.contact_grade }} {{ item.contact_class }}</view>
+        </view>
+      </view>
+      <view class="create_box">
+        <navigator url="/pages/addr/order?notify=addr&type=create" class="create_addr">新建收货地址</navigator>
+      </view>
+    </uni-popup>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				// 购物车列表
-				cartList: [],
-				// 优惠券列表
-				couponList: [],
-				//赠品列表
-				promoRebateList: [],
-				// 请求参数
-				requestParam: {
-					cart_ids: "",
-				},
-				// 总价
-				priceTotal: '0.00',
-				discount: '0.00',
-				reduction: '0.00',
-				// 优惠券使用
-				couponUsed: "去使用 >",
-				// 扣减金额
-				rebatePrice: 0.00,
-				// 已经选择的优惠券ID
-				customCoupon: 0,
-				// 地址列表
-				addrList: [],
-				// 已选地址
-				checkedAddr: {
-					id: 0,
-					contact_name: "",
-					contact_phone: "",
-					contact_province: "",
-					contact_city: "",
-					contact_area: "",
-					contact_addr: "",
-					is_default: 0,
-				}
-			}
-		},
-		onLoad(param) {
-			// 获取路由参数
-			this.requestParam.cart_ids = param.cart_ids;
-			var that = this;
-			// 监听地址变动
-			uni.$on('addr_list_change', function(data) {
-				// 地址列表
-				that.addrList = data.list;
-
-			})
-		},
-		onShow() {
-			// 结果
-			this.$http.request('api/shop_cart/check_list', this.requestParam).then((re) => {
-				if (re.code == 'success') {
-					// 赋值
-					this.cartList = re.data;
-					this.promoRebateList = re.promoRebateList;
-					this.discount = re.discount;
-					this.reduction = re.reduction;
-					// 结果
-					this.$http.request('api/custom_coupon/get_checked', this.requestParam).then((re) => {
-						if (re.code == 'success') {
-							// 赋值
-							this.couponList = re.data;
-							// 推荐使用的优惠券
-							let rebatePrice = 0;
-							// 循环优惠券
-							for (let i in this.couponList) {
-								/* 商品的总价格,决定是否可用 */
-								var totalPrice = 0.00;
-								// 循环产品,
-								for (let j in this.cartList) {
-									// 如果是商品券
-									if (this.couponList[i].type_id == 1) {
-										// 判断商品是不是在商品范围
-										var isScope = false;
-										// 循环商品范围
-										for (let k in this.couponList[i].product_scope) {
-											// 如果存在商品范围
-											if (this.couponList[i].product_scope[k].product_id == this
-												.cartList[j].product_id) isScope = true;
-										}
-										// 范围内的做计算
-										if (isScope) {
-											totalPrice = this.$decimal.add(totalPrice, this.$decimal.mul(
-												this.cartList[j].price, this.cartList[j].buy_num));
-										}
-										// 如果排除商品
-									} else if (this.couponList[i].type_id == 3) {
-										// 判断商品是不是在排除范围
-										var isExclude = false;
-										// 循环排除范围
-										for (let k in this.couponList[i].product_exclude) {
-											// 如果存在排除范围
-											if (this.couponList[i].product_exclude[k].product_id == this
-												.cartList[j].product_id) isExclude = true;
-										}
-										// 不在排除内的做计算
-										if (!isExclude) {
-											totalPrice = this.$decimal.add(totalPrice, this.$decimal.mul(
-												this.cartList[j].price, this.cartList[j].buy_num));
-										}
-										// 店铺券
-									} else {
-										// 折扣券以及满减券的话,计算价格
-										totalPrice = this.$decimal.add(totalPrice, this.$decimal.mul(this
-											.cartList[j].price, this.cartList[j].buy_num));
-									}
-									// 判断价格到不到限额
-									this.couponList[i].is_std = parseFloat(totalPrice.toFixed(2)) >=
-										parseFloat(this.$decimal.mul(this.couponList[i].std_pay, 1)
-											.toFixed(2));
-									// 如果可用的话,并且没有主动选择优惠券
-									if (this.couponList[i].is_std) {
-										// 优惠金额
-										let newRebatePrice = 0.00;
-										// 计算满减价格
-										if (this.couponList[i].rebate_type == 1) {
-											// 计算扣减数据
-											newRebatePrice = this.$decimal.mul(this.couponList[i].rebate,
-												1);
-										}
-										// 计算折扣价格
-										if (this.couponList[i].rebate_type == 2) {
-											// 折扣
-											newRebatePrice = this.$decimal.mul(totalPrice, this.couponList[
-												i].rebate);
-											// 减数
-											newRebatePrice = this.$decimal.sub(totalPrice, newRebatePrice
-												.mul(0.1));
-										}
-										// 判断哪个比较优惠
-										if (parseFloat(rebatePrice.toFixed(2)) < parseFloat(newRebatePrice
-												.toFixed(2))) {
-											// 覆盖价格
-											rebatePrice = parseFloat(newRebatePrice.toFixed(2));
-											// 选中
-											this.checkedCoupon(i);
-										}
-									}
-								}
-							}
-						}
-					});
-					// 计算价格
-					this.priceHandler();
-				}
-			});
-			// 地址列表
-			this.getAddrList();
-		},
-		methods: {
-			// 地址弹出层
-			showAddrPopup() {
-				// 显示下单弹出层
-				this.$refs.addrPopup.open('bottom');
-			},
-			// 价格计算
-			priceHandler() {
-				// 总价格
-				let priceTotal = 0;
-				// 循环处理
-				for (let index in this.cartList) {
-					priceTotal = this.$decimal.add(priceTotal, this.$decimal.mul(this.cartList[index].price, this.cartList[
-						index].buy_num));
-				}
-				// 扣减数据
-				priceTotal = this.$decimal.sub(priceTotal, this.rebatePrice);
-				priceTotal = this.$decimal.sub(priceTotal, this.reduction);
-				priceTotal = this.$decimal.sub(priceTotal, this.discount);
-				// 小数点保留
-				this.priceTotal = priceTotal.toFixed(2)
-			},
-			// 创建订单
-			createOrder() {
-				// 不可预约
-				if (!this.$checkAccess.alertCity()) return;
-				// 需要下单的产品列表
-				let productList = [];
-				// 循环列表数据
-				for (let index in this.cartList) {
-					// 购买数量必须大于0的才行
-					if (this.cartList[index].buy_num > 0) {
-						// 追加需要下单的数据
-						productList.push({
-							product_id: this.cartList[index].product_id,
-							buy_num: this.cartList[index].buy_num,
-							product_skuid: this.cartList[index].skuid
-						});
-					}
-				}
-				if (productList.length <= 0) {
-					uni.showToast({
-						title: "未选择可预约的产品",
-						icon: "none",
-					})
-					return;
-				}
-				// 地址未填
-				if (!this.checkedAddr.id) {
-					uni.showToast({
-						title: "请选择收货地址",
-						icon: "none"
-					})
-					return;
-				}
-				//需要下单的产品信息参数传给OrederCompletion页面
-				let productInfo = [];
-				for (let index in this.cartList) {
-					// 购买数量必须大于0的才行
-					if (this.cartList[index].buy_num > 0) {
-						// 追加需要下单的数据
-						productInfo.push({
-							name: this.cartList[index].name,
-							spec: this.cartList[index].spec,
-							price: this.cartList[index].price
-						});
-					}
-				}
-				// 转成json字符串
-				productInfo = JSON.stringify(productInfo);
-				//加密json格式成编码数组
-				let encodedArray = encodeURIComponent(productInfo);
-				// 转成json字符串传输
-				productList = JSON.stringify(productList);
-				// 请求接口
-				this.$http.request('api/orders/create', {
-					"product_list": productList,
-					'custom_coupon_id': this.customCoupon,
-					'is_cart': 1,
-					'addr_id': this.checkedAddr.id
-				}, 'post').then((re) => {
-					// 判断结果
-					if (re.code == 'success') {
+export default {
+  data() {
+    return {
+      // 购物车列表
+      cartList: [],
+      // 优惠券列表
+      couponList: [],
+      //赠品列表
+      promoRebateList: [],
+      // 请求参数
+      requestParam: {
+        cart_ids: "",
+      },
+      // 总价
+      priceTotal: "0.00",
+      discount: "0.00",
+      reduction: "0.00",
+      // 优惠券使用
+      couponUsed: "去使用 >",
+      // 扣减金额
+      rebatePrice: 0.0,
+      // 已经选择的优惠券ID
+      customCoupon: 0,
+      // 地址列表
+      addrList: [],
+      // 已选地址
+      checkedAddr: {
+        id: 0,
+        contact_name: "",
+        contact_phone: "",
+        contact_province: "",
+        contact_city: "",
+        contact_area: "",
+        contact_addr: "",
+        is_default: 0,
+      },
+    };
+  },
+  onLoad(param) {
+    // 获取路由参数
+    this.requestParam.cart_ids = param.cart_ids;
+    var that = this;
+    // 监听地址变动
+    uni.$on("addr_list_change", function (data) {
+      // 地址列表
+      that.addrList = data.list;
+    });
+  },
+  onShow() {
+    // 结果
+    this.$http.request("api/shop_cart/check_list", this.requestParam).then((re) => {
+      if (re.code == "success") {
+        // 赋值
+        this.cartList = re.data;
+        this.promoRebateList = re.promoRebateList;
+        this.discount = re.discount;
+        this.reduction = re.reduction;
+        // 结果
+        this.$http.request("api/custom_coupon/get_checked", this.requestParam).then((re) => {
+          if (re.code == "success") {
+            // 赋值
+            this.couponList = re.data;
+            // 推荐使用的优惠券
+            let rebatePrice = 0;
+            // 循环优惠券
+            for (let i in this.couponList) {
+              /* 商品的总价格,决定是否可用 */
+              var totalPrice = 0.0;
+              // 循环产品,
+              for (let j in this.cartList) {
+                // 如果是商品券
+                if (this.couponList[i].type_id == 1) {
+                  // 判断商品是不是在商品范围
+                  var isScope = false;
+                  // 循环商品范围
+                  for (let k in this.couponList[i].product_scope) {
+                    // 如果存在商品范围
+                    if (this.couponList[i].product_scope[k].product_id == this.cartList[j].product_id) isScope = true;
+                  }
+                  // 范围内的做计算
+                  if (isScope) {
+                    totalPrice = this.$decimal.add(totalPrice, this.$decimal.mul(this.cartList[j].price, this.cartList[j].buy_num));
+                  }
+                  // 如果排除商品
+                } else if (this.couponList[i].type_id == 3) {
+                  // 判断商品是不是在排除范围
+                  var isExclude = false;
+                  // 循环排除范围
+                  for (let k in this.couponList[i].product_exclude) {
+                    // 如果存在排除范围
+                    if (this.couponList[i].product_exclude[k].product_id == this.cartList[j].product_id) isExclude = true;
+                  }
+                  // 不在排除内的做计算
+                  if (!isExclude) {
+                    totalPrice = this.$decimal.add(totalPrice, this.$decimal.mul(this.cartList[j].price, this.cartList[j].buy_num));
+                  }
+                  // 店铺券
+                } else {
+                  // 折扣券以及满减券的话,计算价格
+                  totalPrice = this.$decimal.add(totalPrice, this.$decimal.mul(this.cartList[j].price, this.cartList[j].buy_num));
+                }
+                // 判断价格到不到限额
+                this.couponList[i].is_std = parseFloat(totalPrice.toFixed(2)) >= parseFloat(this.$decimal.mul(this.couponList[i].std_pay, 1).toFixed(2));
+                // 如果可用的话,并且没有主动选择优惠券
+                if (this.couponList[i].is_std) {
+                  // 优惠金额
+                  let newRebatePrice = 0.0;
+                  // 计算满减价格
+                  if (this.couponList[i].rebate_type == 1) {
+                    // 计算扣减数据
+                    newRebatePrice = this.$decimal.mul(this.couponList[i].rebate, 1);
+                  }
+                  // 计算折扣价格
+                  if (this.couponList[i].rebate_type == 2) {
+                    // 折扣
+                    newRebatePrice = this.$decimal.mul(totalPrice, this.couponList[i].rebate);
+                    // 减数
+                    newRebatePrice = this.$decimal.sub(totalPrice, newRebatePrice.mul(0.1));
+                  }
+                  // 判断哪个比较优惠
+                  if (parseFloat(rebatePrice.toFixed(2)) < parseFloat(newRebatePrice.toFixed(2))) {
+                    // 覆盖价格
+                    rebatePrice = parseFloat(newRebatePrice.toFixed(2));
+                    // 选中
+                    this.checkedCoupon(i);
+                  }
+                }
+              }
+            }
+          }
+        });
+        // 计算价格
+        this.priceHandler();
+      }
+    });
+    // 地址列表
+    this.getAddrList();
+  },
+  methods: {
+    // 地址弹出层
+    showAddrPopup() {
+      // 显示下单弹出层
+      this.$refs.addrPopup.open("bottom");
+    },
+    // 价格计算
+    priceHandler() {
+      // 总价格
+      let priceTotal = 0;
+      // 循环处理
+      for (let index in this.cartList) {
+        priceTotal = this.$decimal.add(priceTotal, this.$decimal.mul(this.cartList[index].price, this.cartList[index].buy_num));
+      }
+      // 扣减数据
+      priceTotal = this.$decimal.sub(priceTotal, this.rebatePrice);
+      priceTotal = this.$decimal.sub(priceTotal, this.reduction);
+      priceTotal = this.$decimal.sub(priceTotal, this.discount);
+      // 小数点保留
+      this.priceTotal = priceTotal.toFixed(2);
+    },
+    // 创建订单
+    createOrder() {
+      // 不可预约
+      if (!this.$checkAccess.alertCity()) return;
+      // 需要下单的产品列表
+      let productList = [];
+      // 循环列表数据
+      for (let index in this.cartList) {
+        // 购买数量必须大于0的才行
+        if (this.cartList[index].buy_num > 0) {
+          // 追加需要下单的数据
+          productList.push({
+            product_id: this.cartList[index].product_id,
+            buy_num: this.cartList[index].buy_num,
+            product_skuid: this.cartList[index].skuid,
+          });
+        }
+      }
+      if (productList.length <= 0) {
+        uni.showToast({
+          title: "未选择可预约的产品",
+          icon: "none",
+        });
+        return;
+      }
+      // 地址未填
+      if (!this.checkedAddr.id) {
+        uni.showToast({
+          title: "请选择收货地址",
+          icon: "none",
+        });
+        return;
+      }
+      //需要下单的产品信息参数传给OrederCompletion页面
+      let productInfo = [];
+      for (let index in this.cartList) {
+        // 购买数量必须大于0的才行
+        if (this.cartList[index].buy_num > 0) {
+          // 追加需要下单的数据
+          productInfo.push({
+            name: this.cartList[index].name,
+            spec: this.cartList[index].spec,
+            price: this.cartList[index].price,
+          });
+        }
+      }
+      // 转成json字符串
+      productInfo = JSON.stringify(productInfo);
+      //加密json格式成编码数组
+      let encodedArray = encodeURIComponent(productInfo);
+      // 转成json字符串传输
+      productList = JSON.stringify(productList);
+      // 请求接口
+      this.$http
+        .request(
+          "api/orders/create",
+          {
+            product_list: productList,
+            custom_coupon_id: this.customCoupon,
+            is_cart: 1,
+            addr_id: this.checkedAddr.id,
+          },
+          "post"
+        )
+        .then((re) => {
+          // 判断结果
+          if (re.code == "success") {
             // 跳转到报单完成页面
             let orderInfo = re.data;
-            orderInfo = JSON.stringify(orderInfo)
+            orderInfo = JSON.stringify(orderInfo);
             let params = encodeURIComponent(orderInfo);
-            uni.navigateTo({url:`/pages/orders/confirm?params=${params}`});
-            return ;
-					} else {
-						uni.showToast({
-							title: re.msg,
-							icon: "none"
-						})
-					}
-				});
-			},
-			// 弹出优惠券
-			popupCoupon() {
-				this.$refs.popup.open();
-			},
-			// 选择优惠券
-			checkedCoupon(index) {
-				// 单个设置选中/未选
-				this.couponList[index].checked = this.couponList[index].checked ? 0 : 1;
-				// 循环处理
-				for (let i in this.couponList) {
-					// 有未选的就不做全选
-					if (index != i) this.couponList[i].checked = 0;
-				}
-				// 如果未选中,提示可用
-				if (!this.couponList[index].checked) this.couponUsed = '去使用 >';
-				// 已经选择的优惠券ID
-				this.customCoupon = this.couponList[index].checked ? this.couponList[index].id : 0
-				// 计算扣减
-				this.couponRebate();
-				// 计算价格
-				this.priceHandler();
-				// 关闭弹窗
-				this.$refs.popup.close();
-			},
-			// 计算优惠券扣减
-			couponRebate() {
-				// 默认扣减0
-				this.rebatePrice = 0;
-				// 循环优惠券
-				for (let i in this.couponList) {
-					// 判断是否选中
-					if (!this.couponList[i].checked) {
-						// 未选择的不管
-						continue;
-					}
-					/* 商品的总价格,决定是否可用 */
-					var totalPrice = 0.00;
-					// 循环产品,
-					for (let j in this.cartList) {
-						// 如果是商品券
-						if (this.couponList[i].type_id == 1) {
-							// 判断商品是不是在商品范围
-							var isScope = false;
-							// 循环商品范围
-							for (let k in this.couponList[i].product_scope) {
-								// 如果存在商品范围
-								if (this.couponList[i].product_scope[k].product_id == this.cartList[j].product_id)
-									isScope = true;
-							}
-							// 范围内的做计算
-							if (isScope) totalPrice = this.$decimal.add(totalPrice, this.$decimal.mul(this.cartList[j]
-								.price, this.cartList[j].buy_num));
-							// 店铺券
-						} else {
-							// 折扣券以及满减券的话,计算价格
-							totalPrice = this.$decimal.add(totalPrice, this.$decimal.mul(this.cartList[j].price, this
-								.cartList[j].buy_num));
-						}
-					}
-					// 如果是可以用的话
-					if (parseFloat(totalPrice.toFixed(2)) >= parseFloat(this.$decimal.mul(this.couponList[i].std_pay, 1)
-							.toFixed(2))) {
-						// 扣减金额
-						let rebatePrice = 0;
-						// 满减
-						if (this.couponList[i].rebate_type == 1) {
-							// 计算扣减数据
-							rebatePrice = this.$decimal.mul(this.couponList[i].rebate, 1);
-							// 替换文字
-							this.couponUsed = "¥-" + rebatePrice.toFixed(2);
-						}
-						// 折扣
-						if (this.couponList[i].rebate_type == 2) {
-							// 折扣
-							rebatePrice = this.$decimal.mul(totalPrice, this.couponList[i].rebate);
-							// -0.1 表示折扣
-							rebatePrice = this.$decimal.sub(totalPrice, rebatePrice.mul(0.1));
-							// 替换文字
-							this.couponUsed = "¥-" + rebatePrice.toFixed(2);
-						}
-						//  赠品
-						if (this.couponList[i].rebate_type == 3) {
-							// 替换文字
-							this.couponUsed = "送" + (this.couponList[i].rebate_scope.length ? this.couponList[i]
-								.rebate_scope[0].product_name : "");
-						}
-						// 小数点保留
-						this.rebatePrice = rebatePrice.toFixed(2);
-					}
-				}
-			},
-			// 选择地址
-			checkedAddrItem(item) {
-				this.checkedAddr = item;
-				this.$refs.addrPopup.close();
-			},
-			getAddrList() {
-				// 判断数据
-				this.$http.request('api/custom_addr/get_list').then((callback) => {
-					// 获取成功
-					if (callback.code == 'success') {
-						this.addrList = callback.data;
-						// 如果有的话
-						if (this.addrList.length) {
-							// 获取默认的
-							for (let i in this.addrList) {
-								// 如果是默认的
-								if (this.addrList[i].is_default) this.checkedAddr = this.addrList[i];
-							}
-							// 如果没有默认的话
-							if (!this.checkedAddr.id) {
-								this.checkedAddr = this.addrList[this.addrList.length - 1];
-							}
-						}
-					}
-				});
-			}
-		}
-	}
+            uni.navigateTo({ url: `/pages/orders/confirm?params=${params}` });
+            return;
+          } else {
+            uni.showToast({
+              title: re.msg,
+              icon: "none",
+            });
+          }
+        });
+    },
+    // 弹出优惠券
+    popupCoupon() {
+      this.$refs.popup.open();
+    },
+    // 选择优惠券
+    checkedCoupon(index) {
+      // 单个设置选中/未选
+      this.couponList[index].checked = this.couponList[index].checked ? 0 : 1;
+      // 循环处理
+      for (let i in this.couponList) {
+        // 有未选的就不做全选
+        if (index != i) this.couponList[i].checked = 0;
+      }
+      // 如果未选中,提示可用
+      if (!this.couponList[index].checked) this.couponUsed = "去使用 >";
+      // 已经选择的优惠券ID
+      this.customCoupon = this.couponList[index].checked ? this.couponList[index].id : 0;
+      // 计算扣减
+      this.couponRebate();
+      // 计算价格
+      this.priceHandler();
+      // 关闭弹窗
+      this.$refs.popup.close();
+    },
+    // 计算优惠券扣减
+    couponRebate() {
+      // 默认扣减0
+      this.rebatePrice = 0;
+      // 循环优惠券
+      for (let i in this.couponList) {
+        // 判断是否选中
+        if (!this.couponList[i].checked) {
+          // 未选择的不管
+          continue;
+        }
+        /* 商品的总价格,决定是否可用 */
+        var totalPrice = 0.0;
+        // 循环产品,
+        for (let j in this.cartList) {
+          // 如果是商品券
+          if (this.couponList[i].type_id == 1) {
+            // 判断商品是不是在商品范围
+            var isScope = false;
+            // 循环商品范围
+            for (let k in this.couponList[i].product_scope) {
+              // 如果存在商品范围
+              if (this.couponList[i].product_scope[k].product_id == this.cartList[j].product_id) isScope = true;
+            }
+            // 范围内的做计算
+            if (isScope) totalPrice = this.$decimal.add(totalPrice, this.$decimal.mul(this.cartList[j].price, this.cartList[j].buy_num));
+            // 店铺券
+          } else {
+            // 折扣券以及满减券的话,计算价格
+            totalPrice = this.$decimal.add(totalPrice, this.$decimal.mul(this.cartList[j].price, this.cartList[j].buy_num));
+          }
+        }
+        // 如果是可以用的话
+        if (parseFloat(totalPrice.toFixed(2)) >= parseFloat(this.$decimal.mul(this.couponList[i].std_pay, 1).toFixed(2))) {
+          // 扣减金额
+          let rebatePrice = 0;
+          // 满减
+          if (this.couponList[i].rebate_type == 1) {
+            // 计算扣减数据
+            rebatePrice = this.$decimal.mul(this.couponList[i].rebate, 1);
+            // 替换文字
+            this.couponUsed = "¥-" + rebatePrice.toFixed(2);
+          }
+          // 折扣
+          if (this.couponList[i].rebate_type == 2) {
+            // 折扣
+            rebatePrice = this.$decimal.mul(totalPrice, this.couponList[i].rebate);
+            // -0.1 表示折扣
+            rebatePrice = this.$decimal.sub(totalPrice, rebatePrice.mul(0.1));
+            // 替换文字
+            this.couponUsed = "¥-" + rebatePrice.toFixed(2);
+          }
+          //  赠品
+          if (this.couponList[i].rebate_type == 3) {
+            // 替换文字
+            this.couponUsed = "送" + (this.couponList[i].rebate_scope.length ? this.couponList[i].rebate_scope[0].product_name : "");
+          }
+          // 小数点保留
+          this.rebatePrice = rebatePrice.toFixed(2);
+        }
+      }
+    },
+    // 选择地址
+    checkedAddrItem(item) {
+      this.checkedAddr = item;
+      this.$refs.addrPopup.close();
+    },
+    getAddrList() {
+      // 判断数据
+      this.$http.request("api/student_addr/get_list").then((callback) => {
+        // 获取成功
+        if (callback.code == "success") {
+          this.addrList = callback.data;
+          // 如果有的话
+          if (this.addrList.length) {
+            // 获取默认的
+            for (let i in this.addrList) {
+              // 如果是默认的
+              if (this.addrList[i].is_default) this.checkedAddr = this.addrList[i];
+            }
+            // 如果没有默认的话
+            if (!this.checkedAddr.id) {
+              this.checkedAddr = this.addrList[this.addrList.length - 1];
+            }
+          }
+        }
+      });
+    },
+  },
+};
 </script>
 
 <style lang="less">
-	.custom_addr {
-		width: 680rpx;
-		display: block;
-		font-size: 24rpx;
-		overflow: hidden;
-		margin: 0rpx auto;
-		line-height: 40rpx;
-		padding: 20rpx 35rpx;
-		background-color: #FFFFFF;
-		border-bottom: 2rpx solid #dddddd;
-
-		.contact_user {
-			display: block;
-			font-size: 24rpx;
-			line-height: 50rpx;
-
-			.contact_none {
-				font-size: 26rpx;
-				font-weight: bold;
-			}
-
-			.contact_name {
-				font-size: 26rpx;
-				font-weight: bold;
-				margin-right: 16rpx;
-			}
-
-			.contact_more {
-				float: right;
-				font-size: 40rpx;
-				font-weight: bold;
-			}
-
-			.contact_shop {
-				float: right;
-				font-size: 26rpx;
-				margin-right: 16rpx;
-			}
-		}
-
-		.contact_addr {
-			width: 620rpx;
-			display: block;
-			font-size: 24rpx;
-			line-height: 30rpx;
-			padding: 10rpx 5rpx;
-		}
-	}
-
-	.car_list {
-		display: block;
-		overflow: hidden;
-		margin: 0rpx auto;
-		margin-top: 20rpx;
-		background: #FFFFFF;
-
-		.car_item {
-			height: 170rpx;
-			display: block;
-			overflow: hidden;
-			margin: 0rpx auto;
-			padding: 20rpx 35rpx;
-			border-bottom: 2rpx solid #DDDDDD;
-
-			.box_left {
-				float: left;
-				width: 140rpx;
-				height: 190rpx;
-				margin-top: 10rpx;
-
-				.car_image {
-					width: 140rpx;
-					height: 140rpx;
-					border-radius: 5rpx;
-				}
-			}
-
-			.box_center {
-				float: left;
-				width: 300rpx;
-				margin-left: 25rpx;
-
-				.car_name {
-					max-height: 70rpx;
-					font-size: 30rpx;
-					line-height: 40rpx;
-					overflow: hidden;
-					white-space: nowrap;
-					/* 不换行 */
-					overflow: hidden;
-					/* 隐藏超出的内容 */
-					text-overflow: ellipsis;
-					/* 用省略号表示被隐藏的部分 */
-				}
-
-				.car_spec {
-					color: #999999;
-					font-size: 24rpx;
-					line-height: 60rpx;
-					max-height: 60rpx;
-					overflow: hidden;
-				}
-
-				.promo_title {
-					max-height: 80rpx;
-					font-size: 20rpx;
-					line-height: 40rpx;
-					overflow: hidden;
-					padding: 0rpx 0rpx;
-					color: #dd524d;
-				}
-
-				.car_price {
-					font-size: 30rpx;
-					line-height: 60rpx;
-
-					.price {
-						color: red;
-					}
-				}
-			}
-
-			.box_right {
-				float: right;
-				width: 185rpx;
-
-				.buy_num_box {
-					float: right;
-					color: #333333;
-					overflow: hidden;
-					font-size: 24rpx;
-					margin-top: 130rpx;
-					text-align: center;
-
-					.buy_num {
-						float: left;
-						width: 100rpx;
-						height: 30rpx;
-						font-size: 24rpx;
-						line-height: 30rpx;
-						padding: 0rpx 0rpx;
-						border-radius: 8rpx;
-					}
-
-				}
-			}
-		}
-
-		.car_item:last-child {
-			border-bottom: none;
-		}
-	}
-
-	.to_select_coupon{
-		display: block;
-		height: 120rpx;
-		font-size: 30rpx;
-		margin: 20rpx auto;
-		background: #FFFFFF;
-		padding: 0rpx 35rpx;
-		line-height: 120rpx;
-
-		.coupon_deduction {
-			color: red;
-			float: right;
-			font-size: 26rpx;
-		}
-	}
-
-	.to_select_coupon:last-child{
-		margin-bottom: 160rpx;
-	}
-
-	.bottom_box {
-		left: 0rpx;
-		z-index: 9;
-		width: 100%;
-		height: 140rpx;
-		display: block;
-		position: fixed;
-		overflow: hidden;
-		background: #FFFFFF;
-		padding: 0rpx 35rpx;
-		bottom: var(--window-bottom);
-
-		.price_box {
-			float: left;
-			width: 500rpx;
-			display: block;
-			color: #666666;
-			font-size: 26rpx;
-			text-align: right;
-			line-height: 100rpx;
-			margin-right: 20rpx;
-
-			.price_total {
-				color: red;
-				font-size: 30rpx;
-			}
-		}
-
-		.to_order {
-			float: left;
-			width: 180rpx;
-			height: 80rpx;
-			display: block;
-			color: #FFFFFF;
-			font-size: 28rpx;
-			margin-top: 10rpx;
-			line-height: 80rpx;
-			padding: 0rpx 0rpx;
-			text-align: center;
-			border-radius: 40rpx;
-			background-color: #E03519;
-		}
-	}
-
-	.popup {
-		.popup_title {
-			display: block;
-			overflow: hidden;
-			margin: 0rpx auto;
-			font-size: 36rpx;
-			height: 120rpx;
-			line-height: 120rpx;
-			padding: 0rpx 20rpx;
-			border-bottom: 10rpx solid #F8F8F8;
-
-			.to_addr_page {
-				float: right;
-				color: #F59A23;
-				display: block;
-				height: 120rpx;
-				line-height: 120rpx;
-				font-size: 26rpx;
-				padding: 0rpx 10rpx;
-			}
-		}
-
-		.coupon_list {
-			display: block;
-			overflow: hidden;
-			margin: 10rpx auto;
-			min-height: 600rpx;
-			background: #FFFFFF;
-			padding-bottom: 50rpx;
-
-			.coupon_item {
-				height: 200rpx;
-				display: block;
-				margin: 10rpx auto;
-				border-bottom: 2rpx solid #DDDDDD;
-
-				.box_left {
-					float: left;
-					width: 160rpx;
-					height: 160rpx;
-					font-size: 20rpx;
-					text-align: center;
-					margin-left: 35rpx;
-					line-height: 60rpx;
-					margin-top: 20rpx;
-					background: pink;
-
-					.rebate {
-						width: 120rpx;
-						height: 60rpx;
-						margin: 0rpx auto;
-						line-height: 60rpx;
-						margin-top: 20rpx;
-						overflow: hidden;
-						white-space: nowrap;
-						text-overflow: ellipsis;
-					}
-				}
-
-				.box_right {
-					float: left;
-					width: 485rpx;
-					margin-left: 35rpx;
-					padding-top: 20rpx;
-
-					.coupon_title {
-						width: 485rpx;
-						max-height: 80rpx;
-						font-size: 30rpx;
-						overflow: hidden;
-						line-height: 40rpx;
-						padding: 0rpx 0rpx;
-
-						.coupon_name {
-							float: left;
-							height: 40rpx;
-							width: 380rpx;
-						}
-
-						.coupon_status {
-							width: 85rpx;
-							float: right;
-							color: #999999;
-							font-size: 24rpx;
-						}
-					}
-
-					.product_scope {
-						width: 485rpx;
-						height: 80rpx;
-						color: #999999;
-						font-size: 24rpx;
-						overflow: hidden;
-						line-height: 80rpx;
-
-						.check_label {
-							float: right;
-							display: block;
-							overflow: hidden;
-							padding: 20rpx 20rpx;
-
-							.isstd {
-								line-height: 40rpx;
-							}
-
-							.checkbox {
-								float: right;
-								width: 40rpx;
-								height: 40rpx;
-							}
-						}
-					}
-
-					.coupon_info {
-						width: 485rpx;
-						max-height: 80rpx;
-						font-size: 30rpx;
-						overflow: hidden;
-						line-height: 40rpx;
-						padding: 0rpx 0rpx;
-
-						.coupon_exp {
-							float: left;
-							font-size: 20rpx;
-						}
-					}
-				}
-			}
-
-			.coupon_item:last-child {
-				border-bottom: none;
-			}
-		}
-
-		.addr_list {
-			width: 730rpx;
-			display: block;
-			overflow: hidden;
-			margin: 0rpx auto;
-			min-height: 500rpx;
-
-			.addr_item {
-				display: block;
-				font-size: 24rpx;
-				overflow: hidden;
-				line-height: 40rpx;
-				padding: 15rpx 10rpx;
-				border-radius: 15rpx;
-				border-bottom: 2rpx solid #dddddd;
-
-				.radio_label {
-					width: 40rpx;
-					float: left;
-					height: 50rpx;
-					padding-top: 30rpx;
-					margin-right: 20rpx;
-
-					.radio_icon {
-						float: left;
-						width: 40rpx;
-						height: 40rpx;
-					}
-				}
-
-				.contact_user {
-					float: left;
-					width: 640rpx;
-					display: block;
-					height: 50rpx;
-					font-size: 24rpx;
-					line-height: 50rpx;
-
-					.contact_name {
-						font-size: 26rpx;
-						font-weight: bold;
-						margin-right: 16rpx;
-					}
-
-					.contact_default {
-						color: #F59A23;
-						font-size: 20rpx;
-						margin-left: 16rpx;
-						border: 1rpx solid #F59A23;
-					}
-
-					.contact_shop {
-						float: right;
-						font-size: 26rpx;
-						margin-right: 16rpx;
-					}
-				}
-
-				.contact_addr {
-					float: left;
-					width: 640rpx;
-					display: block;
-					font-size: 24rpx;
-					line-height: 30rpx;
-					padding: 10rpx 5rpx;
-				}
-			}
-		}
-
-		.create_box {
-			height: 140rpx;
-			display: block;
-
-			.create_addr {
-				width: 700rpx;
-				height: 80rpx;
-				display: block;
-				color: #FFFFFF;
-				font-size: 30rpx;
-				overflow: hidden;
-				line-height: 80rpx;
-				padding: 0rpx 0rpx;
-				text-align: center;
-				margin: 0rpx auto;
-				margin-top: 20rpx;
-				border-radius: 40rpx;
-				background-color: #E03519;
-			}
-		}
-	}
-</style>
+.custom_addr {
+  width: 680rpx;
+  display: block;
+  font-size: 24rpx;
+  overflow: hidden;
+  margin: 0rpx auto;
+  line-height: 40rpx;
+  padding: 20rpx 35rpx;
+  background-color: #ffffff;
+  border-bottom: 2rpx solid #dddddd;
+
+  .contact_user {
+    display: block;
+    font-size: 24rpx;
+    line-height: 50rpx;
+
+    .contact_none {
+      font-size: 26rpx;
+      font-weight: bold;
+    }
+
+    .contact_name {
+      font-size: 26rpx;
+      font-weight: bold;
+      margin-right: 16rpx;
+    }
+
+    .contact_more {
+      float: right;
+      font-size: 40rpx;
+      font-weight: bold;
+    }
+
+    .contact_shop {
+      float: right;
+      font-size: 26rpx;
+      margin-right: 16rpx;
+    }
+  }
+
+  .contact_addr {
+    width: 620rpx;
+    display: block;
+    font-size: 24rpx;
+    line-height: 30rpx;
+    padding: 10rpx 5rpx;
+  }
+}
+
+.car_list {
+  display: block;
+  overflow: hidden;
+  margin: 0rpx auto;
+  margin-top: 20rpx;
+  background: #ffffff;
+
+  .car_item {
+    height: 170rpx;
+    display: block;
+    overflow: hidden;
+    margin: 0rpx auto;
+    padding: 20rpx 35rpx;
+    border-bottom: 2rpx solid #dddddd;
+
+    .box_left {
+      float: left;
+      width: 140rpx;
+      height: 190rpx;
+      margin-top: 10rpx;
+
+      .car_image {
+        width: 140rpx;
+        height: 140rpx;
+        border-radius: 5rpx;
+      }
+    }
+
+    .box_center {
+      float: left;
+      width: 300rpx;
+      margin-left: 25rpx;
+
+      .car_name {
+        max-height: 70rpx;
+        font-size: 30rpx;
+        line-height: 40rpx;
+        overflow: hidden;
+        white-space: nowrap;
+        /* 不换行 */
+        overflow: hidden;
+        /* 隐藏超出的内容 */
+        text-overflow: ellipsis;
+        /* 用省略号表示被隐藏的部分 */
+      }
+
+      .car_spec {
+        color: #999999;
+        font-size: 24rpx;
+        line-height: 60rpx;
+        max-height: 60rpx;
+        overflow: hidden;
+      }
+
+      .promo_title {
+        max-height: 80rpx;
+        font-size: 20rpx;
+        line-height: 40rpx;
+        overflow: hidden;
+        padding: 0rpx 0rpx;
+        color: #dd524d;
+      }
+
+      .car_price {
+        font-size: 30rpx;
+        line-height: 60rpx;
+
+        .price {
+          color: red;
+        }
+      }
+    }
+
+    .box_right {
+      float: right;
+      width: 185rpx;
+
+      .buy_num_box {
+        float: right;
+        color: #333333;
+        overflow: hidden;
+        font-size: 24rpx;
+        margin-top: 130rpx;
+        text-align: center;
+
+        .buy_num {
+          float: left;
+          width: 100rpx;
+          height: 30rpx;
+          font-size: 24rpx;
+          line-height: 30rpx;
+          padding: 0rpx 0rpx;
+          border-radius: 8rpx;
+        }
+      }
+    }
+  }
+
+  .car_item:last-child {
+    border-bottom: none;
+  }
+}
+
+.to_select_coupon {
+  display: block;
+  height: 120rpx;
+  font-size: 30rpx;
+  margin: 20rpx auto;
+  background: #ffffff;
+  padding: 0rpx 35rpx;
+  line-height: 120rpx;
+
+  .coupon_deduction {
+    color: red;
+    float: right;
+    font-size: 26rpx;
+  }
+}
+
+.to_select_coupon:last-child {
+  margin-bottom: 160rpx;
+}
+
+.bottom_box {
+  left: 0rpx;
+  z-index: 9;
+  width: 100%;
+  height: 140rpx;
+  display: block;
+  position: fixed;
+  overflow: hidden;
+  background: #ffffff;
+  padding: 0rpx 35rpx;
+  bottom: var(--window-bottom);
+
+  .price_box {
+    float: left;
+    width: 500rpx;
+    display: block;
+    color: #666666;
+    font-size: 26rpx;
+    text-align: right;
+    line-height: 100rpx;
+    margin-right: 20rpx;
+
+    .price_total {
+      color: red;
+      font-size: 30rpx;
+    }
+  }
+
+  .to_order {
+    float: left;
+    width: 180rpx;
+    height: 80rpx;
+    display: block;
+    color: #ffffff;
+    font-size: 28rpx;
+    margin-top: 10rpx;
+    line-height: 80rpx;
+    padding: 0rpx 0rpx;
+    text-align: center;
+    border-radius: 40rpx;
+    background-color: #e03519;
+  }
+}
+
+.popup {
+  .popup_title {
+    display: block;
+    overflow: hidden;
+    margin: 0rpx auto;
+    font-size: 36rpx;
+    height: 120rpx;
+    line-height: 120rpx;
+    padding: 0rpx 20rpx;
+    border-bottom: 10rpx solid #f8f8f8;
+
+    .to_addr_page {
+      float: right;
+      color: #f59a23;
+      display: block;
+      height: 120rpx;
+      line-height: 120rpx;
+      font-size: 26rpx;
+      padding: 0rpx 10rpx;
+    }
+  }
+
+  .coupon_list {
+    display: block;
+    overflow: hidden;
+    margin: 10rpx auto;
+    min-height: 600rpx;
+    background: #ffffff;
+    padding-bottom: 50rpx;
+
+    .coupon_item {
+      height: 200rpx;
+      display: block;
+      margin: 10rpx auto;
+      border-bottom: 2rpx solid #dddddd;
+
+      .box_left {
+        float: left;
+        width: 160rpx;
+        height: 160rpx;
+        font-size: 20rpx;
+        text-align: center;
+        margin-left: 35rpx;
+        line-height: 60rpx;
+        margin-top: 20rpx;
+        background: pink;
+
+        .rebate {
+          width: 120rpx;
+          height: 60rpx;
+          margin: 0rpx auto;
+          line-height: 60rpx;
+          margin-top: 20rpx;
+          overflow: hidden;
+          white-space: nowrap;
+          text-overflow: ellipsis;
+        }
+      }
+
+      .box_right {
+        float: left;
+        width: 485rpx;
+        margin-left: 35rpx;
+        padding-top: 20rpx;
+
+        .coupon_title {
+          width: 485rpx;
+          max-height: 80rpx;
+          font-size: 30rpx;
+          overflow: hidden;
+          line-height: 40rpx;
+          padding: 0rpx 0rpx;
+
+          .coupon_name {
+            float: left;
+            height: 40rpx;
+            width: 380rpx;
+          }
+
+          .coupon_status {
+            width: 85rpx;
+            float: right;
+            color: #999999;
+            font-size: 24rpx;
+          }
+        }
+
+        .product_scope {
+          width: 485rpx;
+          height: 80rpx;
+          color: #999999;
+          font-size: 24rpx;
+          overflow: hidden;
+          line-height: 80rpx;
+
+          .check_label {
+            float: right;
+            display: block;
+            overflow: hidden;
+            padding: 20rpx 20rpx;
+
+            .isstd {
+              line-height: 40rpx;
+            }
+
+            .checkbox {
+              float: right;
+              width: 40rpx;
+              height: 40rpx;
+            }
+          }
+        }
+
+        .coupon_info {
+          width: 485rpx;
+          max-height: 80rpx;
+          font-size: 30rpx;
+          overflow: hidden;
+          line-height: 40rpx;
+          padding: 0rpx 0rpx;
+
+          .coupon_exp {
+            float: left;
+            font-size: 20rpx;
+          }
+        }
+      }
+    }
+
+    .coupon_item:last-child {
+      border-bottom: none;
+    }
+  }
+
+  .addr_list {
+    width: 730rpx;
+    display: block;
+    overflow: hidden;
+    margin: 0rpx auto;
+    min-height: 500rpx;
+
+    .addr_item {
+      display: block;
+      font-size: 24rpx;
+      overflow: hidden;
+      line-height: 40rpx;
+      padding: 15rpx 10rpx;
+      border-radius: 15rpx;
+      border-bottom: 2rpx solid #dddddd;
+
+      .radio_label {
+        width: 40rpx;
+        float: left;
+        height: 50rpx;
+        padding-top: 30rpx;
+        margin-right: 20rpx;
+
+        .radio_icon {
+          float: left;
+          width: 40rpx;
+          height: 40rpx;
+        }
+      }
+
+      .contact_user {
+        float: left;
+        width: 640rpx;
+        display: block;
+        height: 50rpx;
+        font-size: 24rpx;
+        line-height: 50rpx;
+
+        .contact_name {
+          font-size: 26rpx;
+          font-weight: bold;
+          margin-right: 16rpx;
+        }
+
+        .contact_default {
+          color: #f59a23;
+          font-size: 20rpx;
+          margin-left: 16rpx;
+          border: 1rpx solid #f59a23;
+        }
+
+        .contact_shop {
+          float: right;
+          font-size: 26rpx;
+          margin-right: 16rpx;
+        }
+      }
+
+      .contact_addr {
+        float: left;
+        width: 640rpx;
+        display: block;
+        font-size: 24rpx;
+        line-height: 30rpx;
+        padding: 10rpx 5rpx;
+      }
+    }
+  }
+
+  .create_box {
+    height: 140rpx;
+    display: block;
+
+    .create_addr {
+      width: 700rpx;
+      height: 80rpx;
+      display: block;
+      color: #ffffff;
+      font-size: 30rpx;
+      overflow: hidden;
+      line-height: 80rpx;
+      padding: 0rpx 0rpx;
+      text-align: center;
+      margin: 0rpx auto;
+      margin-top: 20rpx;
+      border-radius: 40rpx;
+      background-color: #e03519;
+    }
+  }
+}
+</style>

+ 455 - 418
pages/coupon/active.vue

@@ -1,426 +1,463 @@
 <template>
-	<view>
-		<view class="banner_box">
-			<image class="banner_img" :src="activeInfo.banner_img" ></image>
-		</view>
-		<view class="active_info">
-			<view class="active_name">{{activeInfo.name}}</view>
-			<view class="active_time">活动时间:{{activeInfo.start_date}} ~ {{activeInfo.end_date}}</view>
-			<view class="active_citys" v-if="activeInfo.city_ids">活动范围:{{activeInfo.city_ids}}</view>
-		</view>
-		<view class="active_coupon">
-			<view class="active_subtitle">优惠券</view>
-			<view class="coupon_list">
-				<view class="coupon_item" v-for="(item,index) in activeInfo.coupon_list" :key="index">
-					<view class="left_box">
-						<view class="rebate" v-if="item.rebate_type == 1" > ¥{{item.rebate}}</view>
-						<view class="rebate" v-if="item.rebate_type == 2" > 打 {{item.rebate}} 折</view>
-						<view class="rebate" v-if="item.rebate_type == 3" > 赠 <text v-if="item.rebate_scope.length">{{item.rebate_scope[0].product_name}}</text> </view>
-						<view class="std_pay">满 ¥{{item.std_pay}} 可用</view>
-						<view class="coupon_exp">有效期:{{item.exp_time}}</view>
-					</view>
-					<view class="right_box">
-						<button class="get_btn" v-if="item.is_have == 0" @click="getCoupon(index)">立即领取</button>
-						<button class="get_btn" v-if="item.is_have == 1"  @click="toUse(item)">去使用</button>
-					</view>
-				</view>
-			</view>
-		</view>
-		<view class="active_product" v-if="activeInfo.product_list.length" >
-			<view class="active_subtitle">活动商品</view>
-			<view class="product_list" :class="show_more_product?'more':''">
-				<view class="product_item" v-for="(item,index) in activeInfo.product_list" :key="index" >
-					<image class="product_image" :src="item.thumb" mode=""></image>
-					<view class="product_name"><text>{{item.product_name}}</text></view>
-					<view class="stock_price">
-						<view class="product_price" >
-							<text >¥ {{item.price}} </text>
-						</view>
-						<view class="product_stock">剩{{item.stock}}个</view>
-					</view>
-				</view>
-			</view>
-			<view class="more_product" v-if="!show_more_product"  @click.stop="show_more_product = true">
-				<uni-icons type="down" size="20" ></uni-icons>
-			</view>
-		</view>
-		<view class="active_rule" v-if="activeInfo.active_rule">
-			<view class="active_subtitle">活动规则</view>
-			<view class="active_rule_info">
-				<rich-text class="rich_text" :nodes="activeInfo.active_rule"></rich-text>
-			</view>
-		</view>
-		<view class="" style="height: 10rpx;"></view>
-	</view>
+  <view>
+    <view class="banner_box">
+      <image class="banner_img" :src="activeInfo.banner_img"></image>
+    </view>
+    <view class="active_info">
+      <view class="active_name">{{ activeInfo.name }}</view>
+      <view class="active_time">活动时间:{{ activeInfo.start_date }} ~ {{ activeInfo.end_date }}</view>
+      <view class="active_citys" v-if="activeInfo.city_ids">活动范围:{{ activeInfo.city_ids }}</view>
+    </view>
+    <view class="active_coupon">
+      <view class="active_subtitle">优惠券</view>
+      <view class="coupon_list">
+        <view class="coupon_item" v-for="(item, index) in activeInfo.coupon_list" :key="index">
+          <view class="left_box">
+            <view class="rebate" v-if="item.rebate_type == 1"> ¥{{ item.rebate }}</view>
+            <view class="rebate" v-if="item.rebate_type == 2"> 打 {{ item.rebate }} 折</view>
+            <view class="rebate" v-if="item.rebate_type == 3">
+              赠 <text v-if="item.rebate_scope.length">{{ item.rebate_scope[0].product_name }}</text>
+            </view>
+            <view class="std_pay">满 ¥{{ item.std_pay }} 可用</view>
+            <view class="coupon_exp">有效期:{{ item.exp_time }}</view>
+          </view>
+          <view class="right_box">
+            <button class="get_btn" v-if="item.is_have == 0" @click="getCoupon(index)">立即领取</button>
+            <button class="get_btn" v-if="item.is_have == 1" @click="toUse(item)">去使用</button>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="active_product" v-if="activeInfo.product_list.length">
+      <view class="active_subtitle">活动商品</view>
+      <view class="product_list" :class="show_more_product ? 'more' : ''">
+        <view class="product_item" v-for="(item, index) in activeInfo.product_list" :key="index">
+          <image class="product_image" :src="item.thumb" mode=""></image>
+          <view class="product_name"
+            ><text>{{ item.product_name }}</text></view
+          >
+          <view class="stock_price">
+            <view class="product_price">
+              <text>¥ {{ item.price }} </text>
+            </view>
+            <view class="product_stock">剩{{ item.stock }}个</view>
+          </view>
+        </view>
+      </view>
+      <view class="more_product" v-if="!show_more_product" @click.stop="show_more_product = true">
+        <uni-icons type="down" size="20"></uni-icons>
+      </view>
+    </view>
+    <view class="active_rule" v-if="activeInfo.active_rule">
+      <view class="active_subtitle">活动规则</view>
+      <view class="active_rule_info">
+        <rich-text class="rich_text" :nodes="activeInfo.active_rule"></rich-text>
+      </view>
+    </view>
+    <view class="" style="height: 10rpx"></view>
+    <uni-popup ref="addFollow" type="center" class="center_popup">
+      <FollowPopup :closePopup="closePopup" :showRule="false" />
+    </uni-popup>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				// 是否显示更多的产品
-				show_more_product:false,
-				// 活动信息
-				activeInfo:{
-					id:0,
-					name:"",
-					banner_img:"",
-					active_rule:"",
-					status:0,
-					start_time:0,
-					end_time:0,
-					city_ids:"",
-					allow_join:0,
-					start_date:"",
-					end_date:"",
-					coupon_list:[],
-					product_list:[],
-				},
-				// 请求参数
-				requestParam:{
-					id:0
-				},
-			}
-		},
-		onLoad(param) {
-			this.requestParam.id = param.id;
-			// #ifdef MP-WEIXIN
-			//分享按钮
-			uni.showShareMenu({
-				withShareTicket: true,
-				menus: ['shareAppMessage', 'shareTimeline']
-			})
-			// #endif
-		},
-		onShareAppMessage(obj) {
-			return {
-				title: this.activeInfo.name,
-				path: '/pages/coupon/active?id='+this.requestParam.id,
-			}
-		},
-		onShow() {
-			// 登录提示
-			if( !this.$checkAccess.alterLogin() )  return ;
-			// 如果存在产品ID的话
-			if( this.requestParam.id > 0) {
-				// 请求详情
-				this.$http.request('api/coupon_active/get_detail',this.requestParam).then((re)=>{
-					// 成功渲染数据
-					if( re.code == 'success' ) {
-						// 刷新数据
-						this.activeInfo = re.data;
-						// 列表大于2.显示
-						if( re.data.product_list.length <= 2 ) this.show_more_product = true;
-					}else{
-						if( re.code != 'no_login' ){
-							uni.showModal({
-								content:re.msg,
-								showCancel:false,
-							})
-						}
-					}
-				});		
-			}else{
-				uni.showModal({
-					content:"未知的活动ID",
-					showCancel:false,
-				})
-			}
-		},
-		methods: {
-			toUse(item){
-				// 没有范围
-				if( item.type_id == 2 ){
-					uni.switchTab({url:"/pages/index/index"});
-					return;
-				}
-				// 只有一个商品,直接跳转到对应商品
-				if( item.product_scope.length == 1 ){
-					uni.navigateTo({
-						url:"/pages/product/index?product_id="+item.product_scope[0]
-					})
-					return;
-				}
-				// 没有范围
-				if( item.product_scope.length > 1 ){
-					uni.navigateTo({
-						url:"/pages/coupon/product?coupon_id="+item.coupon_id
-					});
-					return;
-				}
-			},
-			getCoupon(index){
-				// 获取对应的数据
-				let couponId = this.activeInfo.coupon_list[index].coupon_id;
-				// 如果不能参与
-				if( !this.activeInfo.allow_join ) {
-					uni.showModal({
-						content:"暂不可参与活动",
-						showCancel:false,
-					})
-					return;
-				}
-				// 如果存在优惠券
-				if( couponId > 0) {
-					// 请求详情
-					this.$http.request('api/custom_coupon/get_coupon',{coupon_id:couponId}).then((re)=>{
-						// 成功渲染数据
-						if( re.code == 'success' ) {
-							this.activeInfo.coupon_list[index].is_have = 1;
-						}else{
-							uni.showModal({
-								content:re.msg,
-								showCancel:false,
-							})
-						}
-					});		
-				}else{
-					uni.showModal({
-						content:"请选择要领取的优惠券",
-						showCancel:false,
-					})
-				}
-			}
-		}
-	}
+import FollowPopup from "@/components/FollowPopup/FollowPopup.vue";
+export default {
+  components: {
+    FollowPopup,
+  },
+  data() {
+    return {
+      // 是否显示更多的产品
+      show_more_product: false,
+      // 活动信息
+      activeInfo: {
+        id: 0,
+        name: "",
+        banner_img: "",
+        active_rule: "",
+        status: 0,
+        start_time: 0,
+        end_time: 0,
+        city_ids: "",
+        allow_join: 0,
+        start_date: "",
+        end_date: "",
+        coupon_list: [],
+        product_list: [],
+      },
+      // 请求参数
+      requestParam: {
+        id: 0,
+      },
+    };
+  },
+  onLoad(param) {
+    this.requestParam.id = param.id;
+    this.kailin_uid = param.kailin_uid;
+    this.work_userid = param.work_userid;
+    console.log(param);
+    if (param.work_userid && param.kailin_uid) {
+      this.$http.request("api/work_bind/user", { work_userid: param.work_userid, kailin_uid: param.kailin_uid }).then((re) => {
+        // 成功渲染数据
+        console.log("api/work_bind/user", re);
+      });
+    }
+    // #ifdef MP-WEIXIN
+    //分享按钮
+    uni.showShareMenu({
+      withShareTicket: true,
+      menus: ["shareAppMessage", "shareTimeline"],
+    });
+    // #endif
+  },
+  onShareAppMessage(obj) {
+    return {
+      title: this.activeInfo.name,
+      path: "/pages/coupon/active?id=" + this.requestParam.id,
+    };
+  },
+  onShow() {
+    // 登录提示
+    if (!this.$checkAccess.alterLogin()) return;
+    // 如果存在产品ID的话
+    if (this.requestParam.id > 0) {
+      // 请求详情
+      this.$http.request("api/coupon_active/get_detail", this.requestParam).then((re) => {
+        // 成功渲染数据
+        if (re.code == "success") {
+          // 刷新数据
+          this.activeInfo = re.data;
+          // 列表大于2.显示
+          if (re.data.product_list.length <= 2) this.show_more_product = true;
+        } else {
+          if (re.code != "no_login") {
+            uni.showModal({
+              content: re.msg,
+              showCancel: false,
+            });
+          }
+        }
+      });
+    } else {
+      uni.showModal({
+        content: "未知的活动ID",
+        showCancel: false,
+      });
+    }
+    this.$http.request("api/custom/get_info").then((callback) => {
+      if (callback.code == "success") {
+        // 赋值
+        this.userInfo = callback.data;
+        // 存储登录标识
+        uni.setStorageSync("userInfo", callback.data);
+      }
+    });
+  },
+  methods: {
+    toUse(item) {
+      // 没有范围
+      if (item.type_id == 2) {
+        uni.switchTab({ url: "/pages/index/index" });
+        return;
+      }
+      // 只有一个商品,直接跳转到对应商品
+      if (item.product_scope.length == 1) {
+        uni.navigateTo({
+          url: "/pages/product/index?product_id=" + item.product_scope[0],
+        });
+        return;
+      }
+      // 没有范围
+      if (item.product_scope.length > 1) {
+        uni.navigateTo({
+          url: "/pages/coupon/product?coupon_id=" + item.coupon_id,
+        });
+        return;
+      }
+    },
+    closePopup() {
+      this.$refs.addFollow.close();
+    },
+    getCoupon(index) {
+      // 获取对应的数据
+      let couponId = this.activeInfo.coupon_list[index].coupon_id;
+
+      if (this.userInfo?.have_follow !== 1 && !this.work_userid && !this.kailin_uid) {
+        this.$refs.addFollow.open("center");
+        return;
+      }
+
+      // 如果不能参与
+      if (!this.activeInfo.allow_join) {
+        uni.showModal({
+          content: "暂不可参与活动",
+          showCancel: false,
+        });
+        return;
+      }
+      // 如果存在优惠券
+      if (couponId > 0) {
+        // 请求详情
+        this.$http.request("api/custom_coupon/get_coupon", { coupon_id: couponId }).then((re) => {
+          // 成功渲染数据
+          if (re.code == "success") {
+            this.activeInfo.coupon_list[index].is_have = 1;
+          } else {
+            uni.showModal({
+              content: re.msg,
+              showCancel: false,
+            });
+          }
+        });
+      } else {
+        uni.showModal({
+          content: "请选择要领取的优惠券",
+          showCancel: false,
+        });
+      }
+    },
+  },
+};
 </script>
 
 <style lang="less">
-	.banner_box{
-		width: 750rpx;
-		height: 240rpx;
-		display: block;
-		overflow: hidden;
-		margin: 0rpx auto;
-		.banner_img{
-			width: 750rpx;
-			height: 240rpx;
-		}
-	}
-	.active_info{
-		width: 750rpx;
-		display: block;
-		overflow: hidden;
-		margin: 0rpx auto;
-		padding: 10rpx 35rpx;
-		background-color: #FFFFFF;
-		.active_name{
-			display: block;
-			height: 60rpx;
-			font-size: 36rpx;
-			font-weight: bold;
-			line-height: 60rpx;
-			overflow: hidden;
-			white-space: nowrap;
-			text-overflow: ellipsis;
-		}
-		.active_time{
-			display: block;
-			height: 40rpx;
-			font-size: 26rpx;
-			line-height: 40rpx;
-			overflow: hidden;
-			white-space: nowrap;
-			text-overflow: ellipsis;
-		}
-		.active_citys{
-			display: block;
-			max-height: 80rpx;
-			font-size: 26rpx;
-			line-height: 40rpx;
-			overflow: hidden;
-			white-space: nowrap;
-			text-overflow: ellipsis;
-		}
-	}
-	.active_coupon{
-		display: block;
-		overflow: hidden;
-		margin-top: 20rpx;
-		padding: 0rpx 35rpx;
-		.active_subtitle{
-			display: block;
-			height: 80rpx;
-			overflow: hidden;
-			font-size: 32rpx;
-			font-weight: bold;
-			line-height: 80rpx;
-		}
-		.coupon_list{
-			display: block;
-			overflow: hidden;
-			.coupon_item{
-				display: block;
-				height: 140rpx;
-				overflow: hidden;
-				padding: 10rpx 25rpx;
-				border-radius: 15rpx;
-				margin-bottom: 10rpx;
-				background-color: #FFFFFF;
-				.left_box{
-					float: left;
-					width: 400rpx;
-					height: 140rpx;
-					display: block;
-					.rebate{
-						color: #E03519;
-						height: 60rpx;
-						overflow: hidden;
-						font-size: 36rpx;
-						line-height: 60rpx;
-						font-weight: bold;
-						white-space: nowrap;
-						text-overflow: ellipsis;
-					}
-					.std_pay{
-						color: #666666;
-						height: 40rpx;
-						font-size: 24rpx;
-						line-height: 40rpx;
-					}
-					.coupon_exp{
-						color: #666666;
-						height: 40rpx;
-						font-size: 24rpx;
-						line-height: 40rpx;
-					}
-				}
-				.right_box{
-					float: right;
-					width: 160rpx;
-					height: 60rpx;
-					display: block;
-					margin-top: 40rpx;
-					.get_btn{
-						display: block;
-						width: 160rpx;
-						height: 60rpx;
-						color: #FFFFFF;
-						font-size: 26rpx;
-						line-height: 60rpx;
-						text-align: center;
-						padding: 0rpx 0rpx;
-						border-radius: 10rpx;
-						background-color: #E03519;
-					}
-				}
-			}
-		}
-	}
-	.active_product{
-		display: block;
-		overflow: hidden;
-		margin-top: 10rpx;
-		padding: 0rpx 35rpx;
-		.active_subtitle{
-			display: block;
-			height: 80rpx;
-			overflow: hidden;
-			font-size: 32rpx;
-			font-weight: bold;
-			line-height: 80rpx;
-		}
-		.product_list{
-			display: block;
-			height: 520rpx;
-			overflow: hidden;
-			.product_item{
-				float: left;
-				width: 320rpx;
-				height: 480rpx;
-				display: block;
-				overflow: hidden;
-				margin-top: 20rpx;
-				margin-right: 40rpx;
-				background-color: #FFFFFF;
-				border-radius: 20rpx;
-				.product_image{
-					width: 320rpx;
-					height: 320rpx;
-				}
-				.product_name{
-					height: 80rpx;
-					font-size: 30rpx;
-					line-height: 40rpx;
-					overflow: hidden;
-					margin: 0rpx 0rpx;
-					padding: 0rpx 10rpx;
-					text-overflow: ellipsis;
-				}
-				.stock_price{
-					color: #dddddd;
-					font-size: 20rpx;
-					overflow: hidden;
-					line-height: 30rpx;
-					padding: 0rpx 10rpx;
-					.product_price{
-						float: left;
-						color: red;
-						font-size: 30rpx;
-						line-height: 60rpx;
-						.product_market{
-							font-size: 24rpx;
-							color: #999999;
-							line-height: 30rpx;
-							vertical-align: top;
-							text-decoration: line-through;
-						}
-					}
-					.product_stock{
-						float: right;
-						font-size: 20rpx;
-						line-height: 60rpx;
-					}
-				}
-			}
-			.product_item:nth-child(even){
-				margin-right: 0rpx;
-			}
-		}
-		.product_list.more{
-			height: auto !important;
-		}
-		.more_product{
-			z-index: 8;
-			left: 0rpx;
-			top: -10rpx;
-			height: 40rpx;
-			display: block;
-			font-size: 20rpx;
-			line-height: 40rpx;
-			text-align: center;
-			position: relative;
-			border-radius: 5rpx;
-			background-color: rgba(0, 0, 0, 0.1);
-		}
-	}
-	.active_rule{
-		display: block;
-		overflow: hidden;
-		margin-top: 10rpx;
-		padding: 0rpx 35rpx;
-		margin-bottom: 160rpx;
-		.active_subtitle{
-			display: block;
-			height: 80rpx;
-			overflow: hidden;
-			font-size: 32rpx;
-			font-weight: bold;
-			line-height: 80rpx;
-		}
-		.active_rule_info{
-			display: block;
-			overflow: hidden;
-			font-size: 24rpx;
-			min-height: 500rpx;
-			line-height: 40rpx;
-			border-radius: 10rpx;
-			padding: 20rpx 20rpx;
-			box-sizing: border-box;
-			background-color: #FFFFFF;
-			.rich_text{
-				white-space: break-spaces;
-			}
-		}
-	}
+.banner_box {
+  width: 750rpx;
+  height: 240rpx;
+  display: block;
+  overflow: hidden;
+  margin: 0rpx auto;
+  .banner_img {
+    width: 750rpx;
+    height: 240rpx;
+  }
+}
+.active_info {
+  width: 750rpx;
+  display: block;
+  overflow: hidden;
+  margin: 0rpx auto;
+  padding: 10rpx 35rpx;
+  background-color: #ffffff;
+  .active_name {
+    display: block;
+    height: 60rpx;
+    font-size: 36rpx;
+    font-weight: bold;
+    line-height: 60rpx;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+  }
+  .active_time {
+    display: block;
+    height: 40rpx;
+    font-size: 26rpx;
+    line-height: 40rpx;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+  }
+  .active_citys {
+    display: block;
+    max-height: 80rpx;
+    font-size: 26rpx;
+    line-height: 40rpx;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+  }
+}
+.active_coupon {
+  display: block;
+  overflow: hidden;
+  margin-top: 20rpx;
+  padding: 0rpx 35rpx;
+  .active_subtitle {
+    display: block;
+    height: 80rpx;
+    overflow: hidden;
+    font-size: 32rpx;
+    font-weight: bold;
+    line-height: 80rpx;
+  }
+  .coupon_list {
+    display: block;
+    overflow: hidden;
+    .coupon_item {
+      display: block;
+      height: 140rpx;
+      overflow: hidden;
+      padding: 10rpx 25rpx;
+      border-radius: 15rpx;
+      margin-bottom: 10rpx;
+      background-color: #ffffff;
+      .left_box {
+        float: left;
+        width: 400rpx;
+        height: 140rpx;
+        display: block;
+        .rebate {
+          color: #e03519;
+          height: 60rpx;
+          overflow: hidden;
+          font-size: 36rpx;
+          line-height: 60rpx;
+          font-weight: bold;
+          white-space: nowrap;
+          text-overflow: ellipsis;
+        }
+        .std_pay {
+          color: #666666;
+          height: 40rpx;
+          font-size: 24rpx;
+          line-height: 40rpx;
+        }
+        .coupon_exp {
+          color: #666666;
+          height: 40rpx;
+          font-size: 24rpx;
+          line-height: 40rpx;
+        }
+      }
+      .right_box {
+        float: right;
+        width: 160rpx;
+        height: 60rpx;
+        display: block;
+        margin-top: 40rpx;
+        .get_btn {
+          display: block;
+          width: 160rpx;
+          height: 60rpx;
+          color: #ffffff;
+          font-size: 26rpx;
+          line-height: 60rpx;
+          text-align: center;
+          padding: 0rpx 0rpx;
+          border-radius: 10rpx;
+          background-color: #e03519;
+        }
+      }
+    }
+  }
+}
+.active_product {
+  display: block;
+  overflow: hidden;
+  margin-top: 10rpx;
+  padding: 0rpx 35rpx;
+  .active_subtitle {
+    display: block;
+    height: 80rpx;
+    overflow: hidden;
+    font-size: 32rpx;
+    font-weight: bold;
+    line-height: 80rpx;
+  }
+  .product_list {
+    display: block;
+    height: 520rpx;
+    overflow: hidden;
+    .product_item {
+      float: left;
+      width: 320rpx;
+      height: 480rpx;
+      display: block;
+      overflow: hidden;
+      margin-top: 20rpx;
+      margin-right: 40rpx;
+      background-color: #ffffff;
+      border-radius: 20rpx;
+      .product_image {
+        width: 320rpx;
+        height: 320rpx;
+      }
+      .product_name {
+        height: 80rpx;
+        font-size: 30rpx;
+        line-height: 40rpx;
+        overflow: hidden;
+        margin: 0rpx 0rpx;
+        padding: 0rpx 10rpx;
+        text-overflow: ellipsis;
+      }
+      .stock_price {
+        color: #dddddd;
+        font-size: 20rpx;
+        overflow: hidden;
+        line-height: 30rpx;
+        padding: 0rpx 10rpx;
+        .product_price {
+          float: left;
+          color: red;
+          font-size: 30rpx;
+          line-height: 60rpx;
+          .product_market {
+            font-size: 24rpx;
+            color: #999999;
+            line-height: 30rpx;
+            vertical-align: top;
+            text-decoration: line-through;
+          }
+        }
+        .product_stock {
+          float: right;
+          font-size: 20rpx;
+          line-height: 60rpx;
+        }
+      }
+    }
+    .product_item:nth-child(even) {
+      margin-right: 0rpx;
+    }
+  }
+  .product_list.more {
+    height: auto !important;
+  }
+  .more_product {
+    z-index: 8;
+    left: 0rpx;
+    top: -10rpx;
+    height: 40rpx;
+    display: block;
+    font-size: 20rpx;
+    line-height: 40rpx;
+    text-align: center;
+    position: relative;
+    border-radius: 5rpx;
+    background-color: rgba(0, 0, 0, 0.1);
+  }
+}
+.active_rule {
+  display: block;
+  overflow: hidden;
+  margin-top: 10rpx;
+  padding: 0rpx 35rpx;
+  margin-bottom: 160rpx;
+  .active_subtitle {
+    display: block;
+    height: 80rpx;
+    overflow: hidden;
+    font-size: 32rpx;
+    font-weight: bold;
+    line-height: 80rpx;
+  }
+  .active_rule_info {
+    display: block;
+    overflow: hidden;
+    font-size: 24rpx;
+    min-height: 500rpx;
+    line-height: 40rpx;
+    border-radius: 10rpx;
+    padding: 20rpx 20rpx;
+    box-sizing: border-box;
+    background-color: #ffffff;
+    .rich_text {
+      white-space: break-spaces;
+    }
+  }
+}
 </style>

+ 444 - 389
pages/index/index.vue

@@ -1,398 +1,453 @@
 <template>
-	<view>
-		<!-- 轮播图 -->
-		<view class="banner_box" >
-			<view class="banner_list" v-if="bannerList.length">
-				<swiper class="banner_swiper" :autoplay="true" >
-					<swiper-item v-for="(item,index) in bannerList" :key="index">
-						<image :src="item.thumb" class="image" @click="navLottery(item.link_url)"></image>
-					</swiper-item>
-				</swiper>
-			</view>
-		</view>
-		<view class="product_box">
-			<view class="to_bottom" v-if="!productList.length"> -----还没有产品啦-----</view>
-			<!-- 产品列表 -->
-			<view class="product_list" >
-				<!-- Vue3 项目部分小程序端事件延迟或调用失败 在执行事件的元素上添加 data-eventsync="true" 属性以解决此问题 -->
-				<view @click="toDetail(item)" data-eventsync="true" class="product_item" v-for="(item,index) in productList" :key="index" >
-					<image class="product_image" :src="item.thumb" mode=""></image>
-					<view class="product_name">
-            <text v-if="item.promo_title" class="regiment_title">{{item.promo_title}}</text>
-            <text v-if="item.regiment_title" class="regiment_title">{{item.regiment_title}}</text>
-            <text>{{item.name}}</text></view>
-					<view class="product_spec"><text>{{item.spec}}</text></view>
-					<view class="stock_price">
-						<view class="product_price" v-if="isShowPrice">
-							<text >¥{{item.price}} </text>
-						</view>
-						<view class="product_stock">剩{{item.stock}}个</view>
-					</view>
-				</view>
-			</view>
-		</view>
-		<view class="search_fixed" >
-			<view class="search_box">
-				<view class="city_name" v-if="!toSelectedCity">{{cityName}}</view>
-				<navigator url="/pages/user/info" v-if="toSelectedCity" class="city_name uncheck">选城市</navigator>
-				<input class="search_input" type="text" v-model="requestParam.name" @input="searchChange" placeholder="请输入产品名称搜索" />
-				<button class="search_btn" @click.stop="searchOpen()"  data-eventsync="true"> 搜索</button>
-			</view>
-		</view>
-		<view class="to_bottom" v-if="isLast"> -----{{ !productList.length && toSelectedCity?'请选择您的城市':'到底啦'}}-----</view>
-	</view>
+  <view>
+    <!-- 轮播图 -->
+    <view class="banner_box">
+      <view class="banner_list" v-if="bannerList.length">
+        <swiper class="banner_swiper" :autoplay="true">
+          <swiper-item v-for="(item, index) in bannerList" :key="index">
+            <image :src="item.thumb" class="image" @click="navLottery(item.link_url)"></image>
+          </swiper-item>
+        </swiper>
+      </view>
+    </view>
+    <view class="product_box">
+      <!-- 导航条.tab太多的时候需要使用scrollview -->
+      <scroll-view class="navBar" scroll-x="true" enable-flex>
+        <view v-for="(item, index) in tabs" :key="index" class="navItem">
+          <view class="navItem" :class="requestParam.type_id == item.id ? 'active' : ''" @click="onTabClick(item.id)">
+            <view class="navItemTitle">{{ item.name }}</view>
+          </view>
+        </view>
+      </scroll-view>
+      <view class="to_bottom" v-if="!productList.length"> -----还没有产品啦-----</view>
+      <!-- 产品列表 -->
+      <view class="product_list">
+        <!-- Vue3 项目部分小程序端事件延迟或调用失败 在执行事件的元素上添加 data-eventsync="true" 属性以解决此问题 -->
+        <view @click="toDetail(item)" data-eventsync="true" class="product_item" v-for="(item, index) in productList" :key="index">
+          <view style="width: 100%; display: flex; justify-content: center">
+            <image class="product_image" :src="item.thumb" mode="heightFix"></image>
+          </view>
+          <view class="product_name">
+            <text v-if="item.promo_title" class="regiment_title">{{ item.promo_title }}</text>
+            <text v-if="item.regiment_title" class="regiment_title">{{ item.regiment_title }}</text>
+            <text>{{ item.name }}</text></view
+          >
+          <view class="product_spec"
+            ><text>{{ item.spec }}</text></view
+          >
+          <view class="stock_price">
+            <view class="product_price" v-if="isShowPrice">
+              <text>¥{{ item.price }} </text>
+            </view>
+            <view class="product_stock">剩{{ item.stock }}个</view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="search_fixed">
+      <view class="search_box">
+        <view class="city_name">深圳市</view>
+        <!-- <navigator url="/pages/user/info" v-if="toSelectedCity" class="city_name uncheck">选城市</navigator> -->
+        <input class="search_input" type="text" v-model="requestParam.name" @input="searchChange" placeholder="请输入产品名称搜索" />
+        <button class="search_btn" @click.stop="searchOpen()" data-eventsync="true">搜索</button>
+      </view>
+    </view>
+    <view class="to_bottom" v-if="isLast"> -----{{ !productList.length && toSelectedCity ? "请选择您的城市" : "到底啦" }}-----</view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				// 轮播图
-				bannerList:[],
-				// 产品列表
-				productList:[],
-				// 请求参数
-				requestParam:{
-					name:"",
-					page:1,
-				},
-				// 是否最后一页
-				isLast:false,
-				// 是否请求中
-				isReqing:false,
-				// 是否显示价格
-				isShowPrice:false,
-				// 城市名称
-				cityName:"选城市",
-				// 选择城市
-				toSelectedCity:false,
-			}
-		},
-		onLoad() {
-			// #ifdef MP-WEIXIN
-			//分享按钮
-			uni.showShareMenu({
-				withShareTicket: true,
-				menus: ['shareAppMessage', 'shareTimeline']
-			})
-			// #endif
-		},
-		onShareAppMessage(obj) {
-			// 获取分享信息
-			let shareList 	= getApp().globalData.shareList;
-			// 获取分享信息
-			let shareObj	= {
-								title: '药优惠 得积分 兑豪礼',
-								path: '/pages/index/index',
-								imageUrl:'',
-							};
-			// 循环列表
-			for ( let i in shareList ) {
-				if( shareList[i].pages == 'pages/index/index' ) {
-					shareObj.path  = shareList[i].path ? shareList[i].path : shareObj.path ;
-					shareObj.title  = shareList[i].title ? shareList[i].title : shareObj.title ;
-					shareObj.imageUrl  = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl ;
-				}
-			}
-			// 返回分享信息
-			return shareObj;
-		},
-		onShow() {
-			// 是否显示价格
-			this.isShowPrice 		= this.$checkAccess.checkShowPrice();
-			// 城市名
-			this.cityName			= this.$checkAccess.getCity();
-			// 选城市
-			this.cityName			= this.cityName ? this.cityName : "选城市",
-			// 登录并且未选择城市,才可以选择城市
-			this.toSelectedCity 	= !this.$checkAccess.getCity() ? true : false;
-			// 没有数据的话,或者请求中,不允许刷新
-			if( this.isReqing )		return ;
-			// 获取列表
-			this.$http.request("/api/banner/get_list").then((re)=>{
-				if(re.code === "success"){
-					this.bannerList = re.data;
-				}
-			})
-			// 请求参数
-			this.requestParam.name	= "";
-			// 请求参数
-			this.requestParam.page	= 1;
-			// 是否是最后一页
-			this.isLast			 	= false;
-			// 设置请求中
-			this.isReqing			= true;
-			// 请求
-			this.$http.request('api/product/get_list',this.requestParam).then((re)=>{
-				// 设置非请求中
-				this.isReqing		= false;
-				// 成功结果
-				if( re.code == 'success' ){
-					if(re.data.last_page <= this.requestParam.page ) this.isLast = true;
-					this.productList = re.data.data;
-				}
-			});
-		},
-		onPullDownRefresh() {
-			// 如果请求中,不允许请求,
-			if( this.isReqing )		return false;
-			// 初始化页码为1
-			this.requestParam.page	= 1;
-			// 是否是最后一页
-			this.isLast			 	= false;
-			// 设置请求中
-			this.isReqing			= true;
-			// 请求列表
-			this.$http.request('api/product/get_list',this.requestParam).then((re)=>{
-				// 设置非请求中
-				this.isReqing		= false;
-				// 成功结果
-				if( re.code == 'success' ){
-					if(re.data.last_page <= this.requestParam.page ) this.isLast = true;
-					this.productList = re.data.data;
-				}
-			});
-			uni.stopPullDownRefresh();
-		},
-		onReachBottom() {
-			// 如果页码是0,避免第一页重复
-			if( this.requestParam.page < 1 ) return;
-			// 最后一页不再请求
-			if( this.isLast ) 	return;
-			// 请求中,不再请求
-			if( this.isReqing ) return;
-			// 增加一页
-			this.requestParam.page = this.requestParam.page+1;
-			// 设置请求中
-			this.isReqing			= true;
-			// 请求列表
-			this.$http.request('api/product/get_list',this.requestParam).then((re)=>{
-				// 设置非请求中
-				this.isReqing		= false;
-				// 成功结果
-				if( re.code == 'success' ){
-					// 最后一页
-					if(re.data.last_page <= this.requestParam.page ) this.isLast = true;
-					// 追加数据
-					this.productList.push(...re.data.data);
-				}
-			});
-		},
-		methods: {
-			searchChange(e){
-				// 如果没有搜索词
-				if( !this.requestParam.name ){
-					this.searchOpen();
-				}
-			},
-			searchOpen(){
-				// 请求中,不再请求
-				if( this.isReqing ) 	return;
-				// 是否是最后一页
-				this.isLast			 	= false;
-				// 初始化页码为1
-				this.requestParam.page	= 1;
-				// 设置请求中
-				this.isReqing			= true;
-				// 请求列表
-				this.$http.request('api/product/get_list',this.requestParam).then((re)=>{
-					// 设置非请求中
-					this.isReqing		= false;
-					// 成功结果
-					if( re.code == 'success' ){
-						this.productList = re.data.data;
-						if( re.data.data.length && re.data.last_page >= this.requestParam.page ) this.isLast = true;
-					}
-				});
-			},
-			toDetail(item){
-				uni.navigateTo({
-					url:"/pages/product/index?product_id="+item.id,
-				})
-			},
-			navLottery(url){
-				// 没有路径,不跳转
-				if( !url )	return;
-				// 判断是不是小程序链接
-				if( url.includes('http') ){
-					// 转码
-					let link_url = encodeURIComponent(url);
-					// 跳转到webview
-					uni.redirectTo({
-						url:`/pages/webview/index?link_url=${link_url}`
-					})
-				}else{
-					// 跳转到webview
-					uni.navigateTo({
-						url:url
-					})
-				}
-			}
-		}
-	}
+export default {
+  data() {
+    return {
+      // 轮播图
+      bannerList: [],
+      // 产品列表
+      productList: [],
+      // 请求参数
+      requestParam: {
+        name: "",
+        page: 1,
+        type_id: 0,
+      },
+      // 是否最后一页
+      isLast: false,
+      // 是否请求中
+      isReqing: false,
+      // 是否显示价格
+      isShowPrice: false,
+      // 城市名称
+      cityName: "选城市",
+      // 选择城市
+      toSelectedCity: false,
+      tabs: [
+        {
+          id: 0,
+          name: "全部",
+        },
+      ],
+      tabIndex: 0,
+    };
+  },
+  onLoad() {
+    // #ifdef MP-WEIXIN
+    //分享按钮
+    uni.showShareMenu({
+      withShareTicket: true,
+      menus: ["shareAppMessage", "shareTimeline"],
+    });
+    // #endif
+  },
+  onReady() {
+    // 请求参数
+    this.requestParam.name = "";
+    // 请求参数
+    this.requestParam.page = 1;
+    // 是否是最后一页
+    this.isLast = false;
+    // 设置请求中
+    this.isReqing = true;
+    // 请求
+    this.$http.request("api/product/get_list", this.requestParam).then((re) => {
+      // 设置非请求中
+      this.isReqing = false;
+      // 成功结果
+      if (re.code == "success") {
+        if (re.data.last_page <= this.requestParam.page) this.isLast = true;
+        this.productList = re.data.data;
+      }
+    });
+  },
+  onShareAppMessage(obj) {
+    // 获取分享信息
+    let shareList = getApp().globalData.shareList;
+    // 获取分享信息
+    let shareObj = {
+      title: "学生征订",
+      path: "/pages/index/index",
+      imageUrl: "https://baokan-mp.oss-cn-shenzhen.aliyuncs.com/static/20250213-142749.png",
+    };
+    // 循环列表
+    for (let i in shareList) {
+      if (shareList[i].pages == "pages/index/index") {
+        shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path;
+        shareObj.title = shareList[i].title ? shareList[i].title : shareObj.title;
+        shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl;
+      }
+    }
+    // 返回分享信息
+    return shareObj;
+  },
+  onShow() {
+    // 是否显示价格
+    this.isShowPrice = this.$checkAccess.checkShowPrice();
+    // 城市名
+    this.cityName = this.$checkAccess.getCity();
+    // 选城市
+    (this.cityName = this.cityName ? this.cityName : "选城市"),
+      // 登录并且未选择城市,才可以选择城市
+      (this.toSelectedCity = !this.$checkAccess.getCity() ? true : false);
+    // 没有数据的话,或者请求中,不允许刷新
+    if (this.isReqing) return;
+    // 获取列表
+    this.$http.request("/api/banner/get_list").then((re) => {
+      if (re.code === "success") {
+        this.bannerList = re.data;
+      }
+    });
+    // 获取类型
+    this.$http.request("/api/product/get_type").then((re) => {
+      if (re.code === "success") {
+        // re.data.unshift();
+        this.tabs = this.tabs.concat(re.data || []);
+      }
+    });
+  },
+  onPullDownRefresh() {
+    // 如果请求中,不允许请求,
+    if (this.isReqing) return false;
+    // 初始化页码为1
+    this.requestParam.page = 1;
+    // 是否是最后一页
+    this.isLast = false;
+    // 设置请求中
+    this.isReqing = true;
+    // 请求列表
+    this.$http.request("api/product/get_list", this.requestParam).then((re) => {
+      // 设置非请求中
+      this.isReqing = false;
+      // 成功结果
+      if (re.code == "success") {
+        if (re.data.last_page <= this.requestParam.page) this.isLast = true;
+        this.productList = re.data.data;
+      }
+    });
+    uni.stopPullDownRefresh();
+  },
+  onReachBottom() {
+    // 如果页码是0,避免第一页重复
+    if (this.requestParam.page < 1) return;
+    // 最后一页不再请求
+    if (this.isLast) return;
+    // 请求中,不再请求
+    if (this.isReqing) return;
+    // 增加一页
+    this.requestParam.page = this.requestParam.page + 1;
+    // 设置请求中
+    this.isReqing = true;
+    // 请求列表
+    this.$http.request("api/product/get_list", this.requestParam).then((re) => {
+      // 设置非请求中
+      this.isReqing = false;
+      // 成功结果
+      if (re.code == "success") {
+        // 最后一页
+        if (re.data.last_page <= this.requestParam.page) this.isLast = true;
+        // 追加数据
+        this.productList.push(...re.data.data);
+      }
+    });
+  },
+  methods: {
+    // 处理点击tab
+    onTabClick(index) {
+      this.requestParam.type_id = index;
+      // 如果请求中,不允许请求,
+      this.searchOpen();
+    },
+    searchChange(e) {
+      // 如果没有搜索词
+      if (!this.requestParam.name) {
+        this.searchOpen();
+      }
+    },
+    searchOpen() {
+      // 请求中,不再请求
+      if (this.isReqing) return;
+      // 是否是最后一页
+      this.isLast = false;
+      // 初始化页码为1
+      this.requestParam.page = 1;
+      // 设置请求中
+      this.isReqing = true;
+      // 请求列表
+      this.$http.request("api/product/get_list", this.requestParam).then((re) => {
+        // 设置非请求中
+        this.isReqing = false;
+        // 成功结果
+        if (re.code == "success") {
+          this.productList = re.data.data;
+          if (re.data.data.length && re.data.last_page >= this.requestParam.page) this.isLast = true;
+        }
+      });
+    },
+    toDetail(item) {
+      uni.navigateTo({
+        url: "/pages/product/index?product_id=" + item.id,
+      });
+    },
+    navLottery(url) {
+      // 没有路径,不跳转
+      if (!url) return;
+      // 判断是不是小程序链接
+      if (url.includes("http")) {
+        // 转码
+        let link_url = encodeURIComponent(url);
+        // 跳转到webview
+        uni.redirectTo({
+          url: `/pages/webview/index?link_url=${link_url}`,
+        });
+      } else {
+        // 跳转到webview
+        uni.navigateTo({
+          url: url,
+        });
+      }
+    },
+  },
+};
 </script>
 
 <style lang="less">
-	.search_fixed{
-		top: var(--window-top);
-		left: 0rpx;
-		width: 750rpx;
-		display: block;
-		position: fixed;
-		margin: 0rpx auto;
-		padding: 20rpx 0rpx;
-		background-color: #FFFFFF;
-		.search_box{
-			width: 750rpx;
-			height: 60rpx;
-			display: block;
-			position: relative;
-			.city_name{
-				float: left;
-				width: 80rpx;
-				height: 60rpx;
-				display: block;
-				font-size: 24rpx;
-				overflow: hidden;
-				margin-left: 35rpx;
-				line-height: 60rpx;
-				white-space: nowrap;
-				text-overflow: ellipsis;
-			}
-			.city_name.uncheck{
-				color: #E03519;
-			}
-			.search_input{
-				z-index: 0;
-				float: left;
-				width: 510rpx;
-				height: 56rpx;
-				display: block;
-				font-size: 24rpx;
-				padding-left: 20rpx;
-				position: relative;
-				border-top-left-radius: 40rpx;
-				border-bottom-left-radius: 40rpx;
-				border: 2rpx solid #dddddd;
-			}
-			.search_btn{
-				top: 0rpx;
-				z-index: 9;
-				left: 610rpx;
-				color: #FFFFFF;
-				position: absolute;
-				display: block;
-				width: 120rpx;
-				height: 60rpx;
-				font-size: 24rpx;
-				margin: 0rpx 0rpx;
-				padding: 0rpx 0rpx;
-				line-height: 60rpx;
-				border-radius: 40rpx;
-				background-color: #E03519;
-			}
-		}
-	}
-	.banner_box{
-		width: 680rpx;
-		display: block;
-		overflow: hidden;
-		margin: 0rpx auto;
-		margin-top: 120rpx;
-		.banner_list{
-			display: block;
-			width: 680rpx;
-			height: 382rpx;
-			line-height: 382rpx;
-			text-align: center;
-			.banner_swiper{
-				display: block;
-				width: 680rpx;
-				height: 382rpx;
-				line-height: 382rpx;
-				text-align: center;
-				.image{
-					width: 680rpx;
-					height: 382rpx;
-				}
-			}
-		}
-	}
-	.product_box{
-		display: block;
-		overflow: hidden;
-		margin: 20rpx auto;
-		padding: 0rpx 35rpx;
-		.product_list{
-			display: block;
-			overflow: hidden;
-			margin: 0rpx auto;
-			.product_item{
-				float: left;
-				width: 320rpx;
-				height: 520rpx;
-				display: block;
-				overflow: hidden;
-				margin: 20rpx 0rpx;
-				margin-right: 40rpx;
-				background-color: #FFFFFF;
-				border-radius: 20rpx;
-				.product_image{
-					width: 320rpx;
-					height: 320rpx;
-				}
-				.product_name{
-					height: 80rpx;
-					font-size: 30rpx;
-					line-height: 40rpx;
-					overflow: hidden;
-					margin: 10rpx 0rpx;
-					padding: 0rpx 10rpx;
-					text-overflow: ellipsis;
-          .regiment_title{
-            background-color: red;
-            color: #F9F9F9;
+.search_fixed {
+  top: var(--window-top);
+  left: 0rpx;
+  width: 750rpx;
+  display: block;
+  position: fixed;
+  margin: 0rpx auto;
+  padding: 20rpx 0rpx;
+  background-color: #ffffff;
+
+  .search_box {
+    width: 750rpx;
+    height: 60rpx;
+    display: block;
+    position: relative;
+    .city_name {
+      float: left;
+      width: 80rpx;
+      height: 60rpx;
+      display: block;
+      font-size: 24rpx;
+      overflow: hidden;
+      margin-left: 35rpx;
+      line-height: 60rpx;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+    }
+    .city_name.uncheck {
+      color: #e03519;
+    }
+    .search_input {
+      z-index: 0;
+      float: left;
+      width: 510rpx;
+      height: 56rpx;
+      display: block;
+      font-size: 24rpx;
+      padding-left: 20rpx;
+      position: relative;
+      border-top-left-radius: 40rpx;
+      border-bottom-left-radius: 40rpx;
+      border: 2rpx solid #dddddd;
+    }
+    .search_btn {
+      top: 0rpx;
+      z-index: 9;
+      left: 610rpx;
+      color: #ffffff;
+      position: absolute;
+      display: block;
+      width: 120rpx;
+      height: 60rpx;
+      font-size: 24rpx;
+      margin: 0rpx 0rpx;
+      padding: 0rpx 0rpx;
+      line-height: 60rpx;
+      border-radius: 40rpx;
+      background-color: #e03519;
+    }
+  }
+}
+.banner_box {
+  width: 680rpx;
+  display: block;
+  overflow: hidden;
+  margin: 0rpx auto;
+  margin-top: 120rpx;
+  .banner_list {
+    display: block;
+    width: 680rpx;
+    height: 382rpx;
+    line-height: 382rpx;
+    text-align: center;
+    .banner_swiper {
+      display: block;
+      width: 680rpx;
+      height: 382rpx;
+      line-height: 382rpx;
+      text-align: center;
+      .image {
+        width: 680rpx;
+        height: 382rpx;
+      }
+    }
+  }
+}
+.product_box {
+  display: block;
+  overflow: hidden;
+  margin: 20rpx auto;
+  padding: 0rpx 35rpx;
+  .navBar {
+    display: flex;
+    height: 100rpx;
+    .navItem {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      border-bottom: 4rpx solid transparent;
+      width: max-content;
+      margin: 0 10rpx;
+      .navItemTitle {
+      }
+    }
+    .active {
+      color: #e03519;
+    }
+  }
+
+  .product_list {
+    display: block;
+    overflow: hidden;
+    margin: 0rpx auto;
+    .product_item {
+      float: left;
+      width: 320rpx;
+      height: 520rpx;
+      display: block;
+      overflow: hidden;
+      margin: 20rpx 0rpx;
+      margin-right: 40rpx;
+      background-color: #ffffff;
+      border-radius: 20rpx;
+      .product_image {
+        width: 320rpx;
+        height: 320rpx;
+      }
+      .product_name {
+        height: 80rpx;
+        font-size: 30rpx;
+        line-height: 40rpx;
+        overflow: hidden;
+        margin: 10rpx 0rpx;
+        padding: 0rpx 10rpx;
+        text-overflow: ellipsis;
+        .regiment_title {
+          background-color: red;
+          color: #f9f9f9;
+        }
+      }
+      .product_spec {
+        height: 30rpx;
+        color: #999999;
+        font-size: 24rpx;
+        line-height: 30rpx;
+        padding: 0rpx 10rpx;
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+      }
+      .stock_price {
+        color: #dddddd;
+        font-size: 20rpx;
+        overflow: hidden;
+        line-height: 30rpx;
+        padding: 0rpx 10rpx;
+        .product_price {
+          float: left;
+          color: red;
+          font-size: 30rpx;
+          line-height: 60rpx;
+          .product_market {
+            font-size: 24rpx;
+            color: #999999;
+            line-height: 30rpx;
+            vertical-align: top;
+            text-decoration: line-through;
           }
-				}
-				.product_spec{
-					height: 30rpx;
-					color: #999999;
-					font-size: 24rpx;
-					line-height: 30rpx;
-					padding: 0rpx 10rpx;
-					overflow: hidden;
-					white-space: nowrap;
-					text-overflow: ellipsis;
-				}
-				.stock_price{
-					color: #dddddd;
-					font-size: 20rpx;
-					overflow: hidden;
-					line-height: 30rpx;
-					padding: 0rpx 10rpx;
-					.product_price{
-						float: left;
-						color: red;
-						font-size: 30rpx;
-						line-height: 60rpx;
-						.product_market{
-							font-size: 24rpx;
-							color: #999999;
-							line-height: 30rpx;
-							vertical-align: top;
-							text-decoration: line-through;
-						}
-					}
-					.product_stock{
-						float: right;
-						font-size: 20rpx;
-						line-height: 60rpx;
-					}
-				}
-			}
-			.product_item:nth-child(even){
-				margin-right: 0rpx;
-			}
-		}
-	}
+        }
+        .product_stock {
+          float: right;
+          font-size: 20rpx;
+          line-height: 60rpx;
+        }
+      }
+    }
+    .product_item:nth-child(even) {
+      margin-right: 0rpx;
+    }
+  }
+}
 </style>

+ 88 - 90
pages/login/index.vue

@@ -1,97 +1,95 @@
 <template>
-	<view>
-		<view class="logo_box">
-			<image src="../../static/logo2.jpg" class="logo_image" ></image>
-		</view>
-		<!-- #ifdef MP-WEIXIN -->
-		<button open-type="getPhoneNumber" @getphonenumber="getPhonenumber" class="get_phone">授权登录</button>
-		<!-- #endif -->
-		<!-- #ifdef H5 -->
-		<button @click="toPhoneLogin" class="get_phone">授权登录</button>
-		<!-- #endif -->
-	</view>
+  <view>
+    <view class="logo_box">
+      <image src="../../static/logo2.jpg" class="logo_image"></image>
+    </view>
+    <!-- #ifdef MP-WEIXIN -->
+    <button open-type="getPhoneNumber" @getphonenumber="getPhonenumber" class="get_phone">授权登录</button>
+    <!-- #endif -->
+    <!-- #ifdef H5 -->
+    <button @click="toPhoneLogin" class="get_phone">授权登录</button>
+    <!-- #endif -->
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				
-			}
-		},
-		methods: {
-			getPhonenumber(re){
-				// // 如果授权失败的话
-				if( re.detail.errMsg != "getPhoneNumber:ok"){
-					uni.showToast({
-						icon:"error",
-						title:"授权失败"
-					})
-					return;
-				}
-				// 授权成功以后,调用登录
-				this.$http.request('api/wechat/phone_number',{code:re.detail.code},'post').then((re)=>{
-					// 成功的话
-					if( re.code == 'success' ){
-						// 存储登录标识
-						uni.setStorageSync('userLogin',re.data);
-						// 跳转到页面
-						uni.switchTab({url:"/pages/user/index"})
-					}else{
-						uni.showToast({
-							title: re.msg,
-							icon:"none"
-						})
-					}
-				});
-			},
-			toPhoneLogin(re){
-				// 登录效果
-				this.$http.request('api/wechat/phone_number',this.requestParam).then((re)=>{
-					// 成功的话
-					if( re.code == 'success' ){
-						// 存储登录标识
-						uni.setStorageSync('userLogin',re.data);
-						// 跳转到页面
-						uni.switchTab({url:"/pages/user/index"})
-					}else{
-						uni.showToast({
-							title: re.msg,
-							icon:"none"
-						})
-					}
-				});
-			}
-		}
-	}
+export default {
+  data() {
+    return {};
+  },
+  methods: {
+    getPhonenumber(re) {
+      // // 如果授权失败的话
+      if (re.detail.errMsg != "getPhoneNumber:ok") {
+        uni.showToast({
+          icon: "error",
+          title: "授权失败",
+        });
+        return;
+      }
+      // 授权成功以后,调用登录
+      this.$http.request("api/wechat/phone_number", { code: re.detail.code }, "post").then((re) => {
+        // 成功的话
+        if (re.code == "success") {
+          // 存储登录标识
+          uni.setStorageSync("userLogin", re.data);
+          // 跳转到页面
+          uni.switchTab({ url: "/pages/user/index" });
+        } else {
+          uni.showToast({
+            title: re.msg,
+            icon: "none",
+          });
+        }
+      });
+    },
+    toPhoneLogin(re) {
+      // 登录效果
+      this.$http.request("api/wechat/phone_number", this.requestParam).then((re) => {
+        // 成功的话
+        if (re.code == "success") {
+          // 存储登录标识
+          uni.setStorageSync("userLogin", re.data);
+          // 跳转到页面
+          uni.switchTab({ url: "/pages/user/index" });
+        } else {
+          uni.showToast({
+            title: re.msg,
+            icon: "none",
+          });
+        }
+      });
+    },
+  },
+};
 </script>
 
 <style lang="less">
-	.logo_box{
-		display: block;
-		margin: 0rpx auto;
-		margin-top: 80rpx;
-		.logo_image{
-			width: 320rpx;
-			height: 320rpx;
-			display: block;
-			margin: 0rpx auto;
-		}
-	}
-	.get_phone{
-		display: block;
-		width: 180rpx;
-		height: 60rpx;
-		color: #FFFFFF;
-		font-size: 28rpx;
-		background: green;
-		margin: 0rpx auto;
-		line-height: 60rpx;
-		margin-top: 160rpx;
-		border-radius: 30rpx;
-		border: 0rpx solid #dddddd;
-	}
-	.get_phone::after{
-		border: 0rpx solid #dddddd;
-	}
-</style>
+.logo_box {
+  display: block;
+  margin: 0rpx auto;
+  margin-top: 80rpx;
+  .logo_image {
+    width: 320rpx;
+    height: 320rpx;
+    display: block;
+    margin: 0rpx auto;
+  }
+}
+.get_phone {
+  display: block;
+  width: 180rpx;
+  height: 60rpx;
+  color: #ffffff;
+  font-size: 28rpx;
+  background: green;
+  margin: 0rpx auto;
+  line-height: 60rpx;
+  margin-top: 160rpx;
+  border-radius: 30rpx;
+  border: 0rpx solid #dddddd;
+}
+.get_phone::after {
+  border: 0rpx solid #dddddd;
+}
+</style>

+ 383 - 389
pages/orders/index.vue

@@ -1,401 +1,395 @@
 <template>
-	<view>
-		<view class="order_status_list">
-			<view class="order_status_item" :class="requestParam.status==0?'active':''" @click="setStatus(0)"> 全部 </view>
-			<view class="order_status_item" :class="requestParam.status==1?'active':''" @click="setStatus(1)"> 待跟进 </view>
-			<view class="order_status_item" :class="requestParam.status==4?'active':''" @click="setStatus(4)"> 已取消 </view>
-			<view class="order_status_item" :class="requestParam.status==8?'active':''" @click="setStatus(8)"> 已完成 </view>
-		</view>
-		<view class="to_bottom" v-if="!orderList.length"> -----还没有订单-----</view>
-		<view class="order_list">
-			<view class="order_item" v-for="(item,index) in orderList" :key="index" >
-				<view class="order_title">
-					<view class="business_name">{{item.business_name}}</view>
-					<view class="order_status">{{item.state}}</view>
-				</view>
-				<view  class="product_list" :class="item.contents_class?'active':''">
-					<view class="product_item" v-for="(product_info,k) in item.product_list" :key="k" >
-						<image class="product_img" :src="product_info.product_thumb" mode="" @click="navToProduct(product_info.product_id)"></image>
-						<view class="product_info">
-							<view @click="navToProduct(product_info.product_id)" class="product_name">
-							  <text v-if="product_info.is_rebate">【赠】</text>	{{product_info.product_name}}
-							</view>
-							<view  @click="navToProduct(product_info.product_id)" class="product_spec">
-								{{product_info.product_spec}}
-							</view>
-						</view>
-						<view class="buy_num">
-							x{{product_info.buy_num}}
-						</view>
-					</view>
-				</view>
-				<view class="show_more" v-if="item.product_list.length > 1" @click.stop="changeHeight(index)">
-					<uni-icons :type="item.contents_class?'up':'down'" ></uni-icons>
-				</view>
-				<view class="order_price">
-					<view class="pay_total">¥{{item.pay_total}}</view>
-				</view>
-				<view class="order_btn"v-if="item.status == 1">
-					<button class="order_cancel" @click="cancelOrder(index)">取消订单</button>
-<!--					<button class="order_share" @click="toReceipt(item)">我已收货</button>-->
-					<button class="order_share" @click="toPay(item)">去付款</button>
-				</view>
-        <view class="order_btn"v-if="item.status == 10">
-          <button class="order_cancel" @click="cancelOrderRegiment(index)">取消拼团</button>
+  <view>
+    <view class="order_status_list">
+      <view class="order_status_item" :class="requestParam.status == 0 ? 'active' : ''" @click="setStatus(0)"> 全部 </view>
+      <view class="order_status_item" :class="requestParam.status == 1 ? 'active' : ''" @click="setStatus(1)"> 待跟进 </view>
+      <view class="order_status_item" :class="requestParam.status == 4 ? 'active' : ''" @click="setStatus(4)"> 已取消 </view>
+      <view class="order_status_item" :class="requestParam.status == 8 ? 'active' : ''" @click="setStatus(8)"> 已完成 </view>
+    </view>
+    <view class="to_bottom" v-if="!orderList.length"> -----还没有订单-----</view>
+    <view class="order_list">
+      <view class="order_item" v-for="(item, index) in orderList" :key="index">
+        <view class="order_title">
+          <view class="business_name">{{ item.business_name }}</view>
+          <!-- <view class="order_status">{{ item.state }}</view> -->
         </view>
-        <view class="order_btn"v-if="item.status == 2">
-          <button class="order_share" @click="toCourse(index)">去上课</button>
+        <view class="product_list" :class="item.contents_class ? 'active' : ''">
+          <view class="product_item" v-for="(product_info, k) in item.product_list" :key="k">
+            <image class="product_img" :src="product_info.product_thumb" mode="" @click="navToProduct(product_info.product_id)"></image>
+            <view class="product_info">
+              <view @click="navToProduct(product_info.product_id)" class="product_name"> <text v-if="product_info.is_rebate">【赠】</text> {{ product_info.product_name }} </view>
+              <view @click="navToProduct(product_info.product_id)" class="product_spec">
+                {{ product_info.product_spec }}
+              </view>
+            </view>
+            <view class="buy_num"> x{{ product_info.buy_num }} </view>
+          </view>
+        </view>
+        <view class="show_more" v-if="item.product_list.length > 1" @click.stop="changeHeight(index)">
+          <uni-icons :type="item.contents_class ? 'up' : 'down'"></uni-icons>
+        </view>
+        <view class="order_price">
+          <view class="pay_total">¥{{ item.pay_total }}</view>
+        </view>
+        <view class="order_btn" v-if="item.status == 1">
+          <!-- <button class="order_cancel" @click="cancelOrder(index)">取消订单</button> -->
+          <!--					<button class="order_share" @click="toReceipt(item)">我已收货</button>-->
+          <button class="order_share" @click="toPay(item)">去付款</button>
         </view>
-			</view>
-		</view>
-		<view class="to_bottom" v-if="isLast"> -----到底啦-----</view>
-	</view>
+        <!-- <view class="order_btn" v-if="item.status == 10">
+          <button class="order_cancel" @click="cancelOrderRegiment(index)">取消拼团</button>
+        </view> -->
+        <!-- <view class="order_btn"v-if="item.status == 2">
+          <button class="order_share" @click="toCourse(index)">去上课</button>
+        </view> -->
+      </view>
+    </view>
+    <view class="to_bottom" v-if="isLast"> -----到底啦-----</view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				// 产品列表
-				orderList:[],
-				// 请求参数
-				requestParam:{
-					page:1,
-					status:0,
-				},
-				// 是否最后一页
-				isLast:false,
-				// 是否请求中
-				isReqing:false,
-			};
-		},
-		onLoad() {
-			
-		},
-		onShow() {
-			// 登录提示
-			if( !this.$checkAccess.alterLogin() )  return ;
-			// 没有数据的话,或者请求中,不允许刷新
-			if( this.isReqing )		return ;
-			// 初始化页码为1
-			this.requestParam.page	= 1;
-			// 是否是最后一页
-			this.isLast			 	= false;
-			// 设置请求中
-			this.isReqing			= true;
-			// 请求列表
-			this.$http.request('api/orders/get_list',this.requestParam).then((re)=>{
-				// 设置非请求中
-				this.isReqing		= false;
-				// 成功结果
-				if( re.code == 'success' ){
-					if(re.data.last_page <= this.requestParam.page ) this.isLast = true;
-					this.orderList = re.data.data;
-				}
-			});
-		},
-		onPullDownRefresh() {
-			// 登录提示
-			if( !this.$checkAccess.alterLogin() )  return ;
-			// 如果请求中,不允许请求,
-			if( this.isReqing )		return false;
-			// 初始化页码为1
-			this.requestParam.page	= 1;
-			// 是否是最后一页
-			this.isLast			 	= false;
-			// 设置请求中
-			this.isReqing			= true;
-			// 请求列表
-			this.$http.request('api/orders/get_list',this.requestParam).then((re)=>{
-				// 设置非请求中
-				this.isReqing		= false;
-				// 成功结果
-				if( re.code == 'success' ){
-					if(re.data.last_page <= this.requestParam.page ) this.isLast = true;
-					this.orderList = re.data.data;
-				}
-			});
-			uni.stopPullDownRefresh();
-		},
-		onReachBottom() {
-			// 登录提示
-			if( !this.$checkAccess.alterLogin() )  return ;
-			// 如果页码是0,避免第一页重复
-			if( this.requestParam.page < 1 ) return;
-			// 最后一页不请求
-			if( this.isLast )		return;
-			// 请求中,不再请求
-			if( this.isReqing )		return;
-			// 增加一页
-			this.requestParam.page	= this.requestParam.page+1;
-			// 设置请求中
-			this.isReqing			= true;
-			// 请求列表
-			this.$http.request('api/orders/get_list',this.requestParam).then((re)=>{
-				// 设置非请求中
-				this.isReqing		= false;
-				// 成功结果
-				if( re.code == 'success' ){
-					if(re.data.last_page <= this.requestParam.page ) this.isLast = true;
-					// 追加数据
-					this.orderList.push(... re.data.data);
-				}
-			});
-		},
-		methods:{
-			setStatus(status){
-				// 登录提示
-				if( !this.$checkAccess.alterLogin() )  return ;
-				// 请求中,不再请求
-				if( this.isReqing ) 		return;
-				// 初始化页码为1
-				this.requestParam.page		= 1;
-				// 是否是最后一页
-				this.isLast			 		= false;
-				// 状态变更
-				this.requestParam.status	= status;
-				// 设置请求中
-				this.isReqing				= true;
-				// 请求列表
-				this.$http.request('api/orders/get_list',this.requestParam).then((re)=>{
-					// 设置非请求中
-					this.isReqing			= false;
-					// 成功结果
-					if( re.code == 'success' ){
-						if(re.data.last_page >= this.requestParam.page ) this.isLast = true;
-						this.orderList = re.data.data;
-					}
-				});
-			},
-			changeHeight(index){
-				this.orderList[index].contents_class  = this.orderList[index].contents_class ? 0:1;
-			},
-			// 取消订单
-			cancelOrder(index){
-				uni.showModal({
-					title:"确认取消该订单?",
-					success:res=>{
-						if (res.confirm) {
-							// 请求列表
-							this.$http.request('api/orders/cancel',{id:this.orderList[index].id}).then(re=>{
-								this.orderList[index].state  = '已取消';
-								this.orderList[index].status = 4;
-							});
-						}
-					}
-				})
-			},
-      // 取消拼团
-      cancelOrderRegiment(index){
-        uni.showModal({
-          title:"确认取消该订单?",
-          success:res=>{
-            if (res.confirm) {
-              // 请求列表
-              this.$http.request('api/orders/cancel_regiment',{id:this.orderList[index].id}).then(re=>{
-                this.orderList[index].state  = '已取消';
-                this.orderList[index].status = 4;
-              });
-            }
-          }
-        })
+export default {
+  data() {
+    return {
+      // 产品列表
+      orderList: [],
+      // 请求参数
+      requestParam: {
+        page: 1,
+        status: 0,
       },
-			navToProduct(id){
-				if( id ){
-					uni.navigateTo({
-						url:"/pages/product/index?product_id="+id
-					})
-				}
-			},
-			toReceipt(item){
-				uni.navigateTo({
-					url:"/pages/orders/receipt?order_id="+item.id
-				})
-			},
-      toPay(item){
-        if (item){
-          let orderInfo = {
-            snowflake_id:item.snowflake_id,
-            pay_total:item.pay_total,
-            order_id:item.id,
-          };
-          orderInfo = JSON.stringify(orderInfo);
-          let params = encodeURIComponent(orderInfo);
-          // 跳转到确认支付页面
-          uni.navigateTo({url:`/pages/orders/confirm?params=${params}`});
-        }else {
-          uni.showToast({
-            title:"订单数据错误",
-            icon:"none"
-          })
-          return;
+      // 是否最后一页
+      isLast: false,
+      // 是否请求中
+      isReqing: false,
+    };
+  },
+  onLoad() {},
+  onShow() {
+    // 登录提示
+    if (!this.$checkAccess.alterLogin()) return;
+    // 没有数据的话,或者请求中,不允许刷新
+    if (this.isReqing) return;
+    // 初始化页码为1
+    this.requestParam.page = 1;
+    // 是否是最后一页
+    this.isLast = false;
+    // 设置请求中
+    this.isReqing = true;
+    // 请求列表
+    this.$http.request("api/orders/get_list", this.requestParam).then((re) => {
+      // 设置非请求中
+      this.isReqing = false;
+      // 成功结果
+      if (re.code == "success") {
+        if (re.data.last_page <= this.requestParam.page) this.isLast = true;
+        this.orderList = re.data.data;
+      }
+    });
+  },
+  onPullDownRefresh() {
+    // 登录提示
+    if (!this.$checkAccess.alterLogin()) return;
+    // 如果请求中,不允许请求,
+    if (this.isReqing) return false;
+    // 初始化页码为1
+    this.requestParam.page = 1;
+    // 是否是最后一页
+    this.isLast = false;
+    // 设置请求中
+    this.isReqing = true;
+    // 请求列表
+    this.$http.request("api/orders/get_list", this.requestParam).then((re) => {
+      // 设置非请求中
+      this.isReqing = false;
+      // 成功结果
+      if (re.code == "success") {
+        if (re.data.last_page <= this.requestParam.page) this.isLast = true;
+        this.orderList = re.data.data;
+      }
+    });
+    uni.stopPullDownRefresh();
+  },
+  onReachBottom() {
+    // 登录提示
+    if (!this.$checkAccess.alterLogin()) return;
+    // 如果页码是0,避免第一页重复
+    if (this.requestParam.page < 1) return;
+    // 最后一页不请求
+    if (this.isLast) return;
+    // 请求中,不再请求
+    if (this.isReqing) return;
+    // 增加一页
+    this.requestParam.page = this.requestParam.page + 1;
+    // 设置请求中
+    this.isReqing = true;
+    // 请求列表
+    this.$http.request("api/orders/get_list", this.requestParam).then((re) => {
+      // 设置非请求中
+      this.isReqing = false;
+      // 成功结果
+      if (re.code == "success") {
+        if (re.data.last_page <= this.requestParam.page) this.isLast = true;
+        // 追加数据
+        this.orderList.push(...re.data.data);
+      }
+    });
+  },
+  methods: {
+    setStatus(status) {
+      // 登录提示
+      if (!this.$checkAccess.alterLogin()) return;
+      // 请求中,不再请求
+      if (this.isReqing) return;
+      // 初始化页码为1
+      this.requestParam.page = 1;
+      // 是否是最后一页
+      this.isLast = false;
+      // 状态变更
+      this.requestParam.status = status;
+      // 设置请求中
+      this.isReqing = true;
+      // 请求列表
+      this.$http.request("api/orders/get_list", this.requestParam).then((re) => {
+        // 设置非请求中
+        this.isReqing = false;
+        // 成功结果
+        if (re.code == "success") {
+          if (re.data.last_page >= this.requestParam.page) this.isLast = true;
+          this.orderList = re.data.data;
         }
-      },
-      toCourse(item){
-        uni.switchTab({
-          url:"/pages/course/index?order_id="+item.id,
-        })
-      },
-		}
-	}
+      });
+    },
+    changeHeight(index) {
+      this.orderList[index].contents_class = this.orderList[index].contents_class ? 0 : 1;
+    },
+    // 取消订单
+    cancelOrder(index) {
+      uni.showModal({
+        title: "确认取消该订单?",
+        success: (res) => {
+          if (res.confirm) {
+            // 请求列表
+            this.$http.request("api/orders/cancel", { id: this.orderList[index].id }).then((re) => {
+              this.orderList[index].state = "已取消";
+              this.orderList[index].status = 4;
+            });
+          }
+        },
+      });
+    },
+    // 取消拼团
+    cancelOrderRegiment(index) {
+      uni.showModal({
+        title: "确认取消该订单?",
+        success: (res) => {
+          if (res.confirm) {
+            // 请求列表
+            this.$http.request("api/orders/cancel_regiment", { id: this.orderList[index].id }).then((re) => {
+              this.orderList[index].state = "已取消";
+              this.orderList[index].status = 4;
+            });
+          }
+        },
+      });
+    },
+    navToProduct(id) {
+      if (id) {
+        uni.navigateTo({
+          url: "/pages/product/index?product_id=" + id,
+        });
+      }
+    },
+    toReceipt(item) {
+      uni.navigateTo({
+        url: "/pages/orders/receipt?order_id=" + item.id,
+      });
+    },
+    toPay(item) {
+      if (item) {
+        let orderInfo = {
+          snowflake_id: item.snowflake_id,
+          pay_total: item.pay_total,
+          order_id: item.id,
+        };
+        orderInfo = JSON.stringify(orderInfo);
+        let params = encodeURIComponent(orderInfo);
+        // 跳转到确认支付页面
+        uni.navigateTo({ url: `/pages/orders/confirm?params=${params}` });
+      } else {
+        uni.showToast({
+          title: "订单数据错误",
+          icon: "none",
+        });
+        return;
+      }
+    },
+    toCourse(item) {
+      uni.switchTab({
+        url: "/pages/course/index?order_id=" + item.id,
+      });
+    },
+  },
+};
 </script>
 
 <style lang="less">
-	.order_status_list{
-		display: block;
-		height: 60rpx;
-		color: #666666;
-		line-height: 60rpx;
-		background: #FFFFFF;
-		padding: 10rpx 35rpx;
-		.order_status_item{
-			float: left;
-			font-size: 28rpx;
-			padding: 0rpx 20rpx;
-		}
-		.order_status_item.active{
-			color: #000000;
-			font-weight: bold;
-		}
-	}
-	.order_list{
-		display:block;
-		overflow: hidden;
-		margin: 0rpx auto;
-		.order_item{
-			display: block;
-			background: #FFFFFF;
-			margin: 0rpx auto;
-			padding: 0rpx 35rpx;
-			margin-bottom: 10rpx;
-			.order_title{
-				width: 100%;
-				height: 60rpx;
-				display: block;
-				overflow: hidden;
-				line-height: 60rpx;
-				.business_name{
-					float: left;
-					font-size: 32rpx;
-				}
-				.order_status{
-					float: right;
-					color: #999999;
-					font-size: 24rpx;
-				}
-			}
-			.product_list{
-				display: block;
-			    height: 100rpx;
-				overflow: hidden;
-				margin: 15rpx auto;
-				.product_item{
-					display: block;
-					height: 100rpx;
-					overflow: hidden;
-					.product_img{
-						float: left;
-						width: 80rpx;
-						height: 80rpx;
-						display: block;
-						margin-top: 10rpx;
-						margin-right: 30rpx;
-					}
-					.product_info{
-						float: left;
-						width: 480rpx;
-						height: 100rpx;
-						display: block;
-						overflow: hidden;
-						.product_name{
-							display: block;
-							height: 60rpx;
-							display: block;
-							font-size: 28rpx;
-							line-height: 60rpx;
-							overflow: hidden;
-						}
-						.product_spec{
-							color: #999999;
-							height: 40rpx;
-							display: block;
-							font-size: 24rpx;
-							line-height: 40rpx;
-							overflow: hidden;
-						}
-					}
-					.buy_num{
-						float: right;
-						height: 100rpx;
-						color: #999999;
-						font-size: 26rpx;
-						text-align: right;
-						position: relative;
-						line-height: 100rpx;
-					}
-				}
-			}
-			.product_list.active{
-				height: auto !important;
-			}
-			.order_price{
-				display: block;
-				height: 60rpx;
-				overflow: hidden;
-				line-height: 60rpx;
-				.pay_total{
-					float: right;
-					height: 60rpx;
-					color: #E03519;
-					font-size: 28rpx;
-					line-height: 60rpx;
-				}
-			}
-			.show_more{
-				width: 100%;
-				height: 30rpx;
-				display: block;
-				font-size: 20rpx !important;
-				margin-top: -30rpx;
-				text-align: center;
-				position: relative;
-				background-color: rgba(0, 0, 0, 0.05);
-			}
-			.order_btn{
-				display: block;
-				height: 60rpx;
-				overflow: hidden;
-				.order_cancel{
-					float: left;
-					height: 50rpx;
-					color: #999999;
-					font-size: 24rpx;
-					padding: 0rpx 10rpx;
-					line-height: 50rpx;
-					margin-left: 10rpx;
-					border-radius: 25rpx;
-					border: 2rpx solid #999999;
-					background-color: transparent;
-				}
-				.order_cancel::after{
-					border: none;
-				}
-				.order_share{
-					float: right;
-					height: 50rpx;
-					color: #E03519;
-					font-size: 24rpx;
-					padding: 0rpx 10rpx;
-					line-height: 50rpx;
-					margin-left: 10rpx;
-					border-radius: 25rpx;
-					border: 2rpx solid #E03519;
-					background-color: transparent;
-				}
-				.order_share::after{
-					border: none;
-				}
-			}
-		}
-	}
+.order_status_list {
+  display: block;
+  height: 60rpx;
+  color: #666666;
+  line-height: 60rpx;
+  background: #ffffff;
+  padding: 10rpx 35rpx;
+  .order_status_item {
+    float: left;
+    font-size: 28rpx;
+    padding: 0rpx 20rpx;
+  }
+  .order_status_item.active {
+    color: #000000;
+    font-weight: bold;
+  }
+}
+.order_list {
+  display: block;
+  overflow: hidden;
+  margin: 0rpx auto;
+  .order_item {
+    display: block;
+    background: #ffffff;
+    margin: 0rpx auto;
+    padding: 0rpx 35rpx;
+    margin-bottom: 10rpx;
+    .order_title {
+      width: 100%;
+      height: 60rpx;
+      display: block;
+      overflow: hidden;
+      line-height: 60rpx;
+      .business_name {
+        float: left;
+        font-size: 32rpx;
+      }
+      .order_status {
+        float: right;
+        color: #999999;
+        font-size: 24rpx;
+      }
+    }
+    .product_list {
+      display: block;
+      height: 100rpx;
+      overflow: hidden;
+      margin: 15rpx auto;
+      .product_item {
+        display: block;
+        height: 100rpx;
+        overflow: hidden;
+        .product_img {
+          float: left;
+          width: 80rpx;
+          height: 80rpx;
+          display: block;
+          margin-top: 10rpx;
+          margin-right: 30rpx;
+        }
+        .product_info {
+          float: left;
+          width: 480rpx;
+          height: 100rpx;
+          display: block;
+          overflow: hidden;
+          .product_name {
+            display: block;
+            height: 60rpx;
+            display: block;
+            font-size: 28rpx;
+            line-height: 60rpx;
+            overflow: hidden;
+          }
+          .product_spec {
+            color: #999999;
+            height: 40rpx;
+            display: block;
+            font-size: 24rpx;
+            line-height: 40rpx;
+            overflow: hidden;
+          }
+        }
+        .buy_num {
+          float: right;
+          height: 100rpx;
+          color: #999999;
+          font-size: 26rpx;
+          text-align: right;
+          position: relative;
+          line-height: 100rpx;
+        }
+      }
+    }
+    .product_list.active {
+      height: auto !important;
+    }
+    .order_price {
+      display: block;
+      height: 60rpx;
+      overflow: hidden;
+      line-height: 60rpx;
+      .pay_total {
+        float: right;
+        height: 60rpx;
+        color: #e03519;
+        font-size: 28rpx;
+        line-height: 60rpx;
+      }
+    }
+    .show_more {
+      width: 100%;
+      height: 30rpx;
+      display: block;
+      font-size: 20rpx !important;
+      margin-top: -30rpx;
+      text-align: center;
+      position: relative;
+      background-color: rgba(0, 0, 0, 0.05);
+    }
+    .order_btn {
+      display: block;
+      height: 60rpx;
+      overflow: hidden;
+      .order_cancel {
+        float: left;
+        height: 50rpx;
+        color: #999999;
+        font-size: 24rpx;
+        padding: 0rpx 10rpx;
+        line-height: 50rpx;
+        margin-left: 10rpx;
+        border-radius: 25rpx;
+        border: 2rpx solid #999999;
+        background-color: transparent;
+      }
+      .order_cancel::after {
+        border: none;
+      }
+      .order_share {
+        float: right;
+        height: 50rpx;
+        color: #e03519;
+        font-size: 24rpx;
+        padding: 0rpx 10rpx;
+        line-height: 50rpx;
+        margin-left: 10rpx;
+        border-radius: 25rpx;
+        border: 2rpx solid #e03519;
+        background-color: transparent;
+      }
+      .order_share::after {
+        border: none;
+      }
+    }
+  }
+}
 </style>

+ 29 - 15
pages/product/index.vue

@@ -2,7 +2,7 @@
 	<page-meta :page-style="'overflow:'+(show?'hidden':'visible')"></page-meta>
 	<view>
 		<view class="product_image_box" v-if="!productInfo.photo_list.length">
-			<image class="product_image" :src="sku_thumb"></image>
+			<image class="product_image" :src="sku_thumb" mode="heightFix"></image>
 		</view>
 		<view class="product_image_box" v-if="productInfo.photo_list.length">
 			<swiper class="photo_list" :autoplay="true">
@@ -15,7 +15,7 @@
 			<view class="stock_price" v-if="isShowPrice">
 				<view class="product_price">
 					<text>¥{{productInfo.price}} </text>
-					<text class="product_market">¥{{productInfo.market_price}} </text>
+					<!-- <text class="product_market">¥{{productInfo.market_price}} </text> -->
 				</view>
 			</view>
 			<view class="product_name">
@@ -77,6 +77,9 @@
 		<view class="product_poster" v-if="productInfo.poster">
 			<image class="product_image" :src="productInfo.poster" mode="widthFix"></image>
 		</view>
+		<view class="product_poster" @click="_checkFollow">
+			<image class="product_image" src="https://baokan-mp.oss-cn-shenzhen.aliyuncs.com/banner/20250213-105940.jpg" mode="widthFix"></image>
+		</view>
 		<view class="order_car" v-if="productInfo.regiment_type === 2">
 			<navigator url="/pages/car/index" open-type="switchTab" class="to_car">
 				<image src="../../static/icon/car.png" class="car_icon"></image>
@@ -120,10 +123,7 @@
 						<text class="contact_more"> &gt;</text>
 						<text class="contact_shop">{{checkedAddr.contact_shop}}</text>
 					</view>
-					<view class="contact_addr">
-						{{checkedAddr.contact_province}} {{checkedAddr.contact_city}} {{checkedAddr.contact_area}}
-						{{checkedAddr.contact_addr}}
-					</view>
+					<view class="contact_addr"> {{ checkedAddr.contact_area }} {{ checkedAddr.contact_school }} {{ checkedAddr.contact_grade }} {{ checkedAddr.contact_class }} </view>
 				</view>
 				<view class="car_item">
 					<view class="box_left">
@@ -134,9 +134,9 @@
             <view v-if="productInfo.promo_title" class="promo_title">{{productInfo.promo_title}}</view>
 						<view class="stock_price">
 							<view class="product_price" v-if="isShowPrice">
-								<text v-if="specBtnType==1">¥{{productInfo.price}} </text>
-								<text v-if="specBtnType==3 || specBtnType==4">¥{{productInfo.regiment_price}} </text>
-								<text class="car_market">¥{{productInfo.market_price}}</text>
+								<text>¥{{productInfo.price}} </text>
+								<!-- <text v-if="specBtnType==3 || specBtnType==4">¥{{productInfo.regiment_price}} </text> -->
+								<!-- <text class="car_market">¥{{productInfo.market_price}}</text> -->
 							</view>
 							<view class="product_quantity_box">
 								<button class="product_quantity_sub" @click="changeQuantity(-1)" data-eventsync="true">
@@ -226,7 +226,7 @@
 			</view>
 		</uni-popup>
 		<uni-popup ref="addrPopup" type="bottom" class="popup" background-color="#FFFFFF">
-			<view class="popup_title">收货地址 <navigator url="/pages/addr/index?notify=addr" class="to_addr_page">管理
+			<view class="popup_title">收货地址 <navigator url="/pages/addr/order?order=addr" class="to_addr_page">管理
 				</navigator>
 			</view>
 			<view class="addr_list">
@@ -242,13 +242,11 @@
 						<text class="contact_default" v-if="item.is_default">默认</text>
 						<text class="contact_shop">{{item.contact_shop}}</text>
 					</view>
-					<view class="contact_addr">
-						{{item.contact_province}} {{item.contact_city}} {{item.contact_area}} {{item.contact_addr}}
-					</view>
+					<view class="contact_addr"> {{ item.contact_area }} {{ item.contact_school }} {{ item.contact_grade }} {{ item.contact_class }} </view>
 				</view>
 			</view>
 			<view class="create_box">
-				<navigator url="/pages/addr/index?notify=addr&type=create" class="create_addr">新建收货地址</navigator>
+				<navigator url="/pages/addr/order?notify=addr&type=create" class="create_addr">新建收货地址</navigator>
 			</view>
 		</uni-popup>
 		<uni-popup ref="addFollow" type="center" class="center_popup" @change="popupChange">
@@ -296,10 +294,17 @@
 				</view>
 			</view>
 		</uni-popup>
+		<uni-popup ref="addFollow" type="center" class="center_popup">
+			<FollowPopup :closePopup="closePopup" :showRule="false" />
+		</uni-popup>
 	</view>
 </template>
 <script>
+	import FollowPopup from "@/components/FollowPopup/FollowPopup.vue";
 	export default {
+		components: {
+			FollowPopup,
+		},
 		data() {
 			return {
 				show: false, // 使用Popup组件时,阻止禁止滚动穿透
@@ -443,6 +448,15 @@
 			}
 		},
 		methods: {
+			closePopup() {
+				this.$refs.addFollow.close();
+			},
+			_checkFollow(){
+				if (!this.$checkAccess.getHasFollow()) {
+					this.$refs.addFollow.open("center");
+					return;
+				}
+			},
 			//计算剩余时间
 			remainder(end_time, type) {
 				const now = Math.floor(Date.now() / 1000);
@@ -957,7 +971,7 @@
 			},
 			getAddrList() {
 				// 判断数据
-				this.$http.request('api/custom_addr/get_list').then((callback) => {
+				this.$http.request('api/student_addr/get_list').then((callback) => {
 					// 获取成功
 					if (callback.code == 'success') {
 						this.addrList = callback.data;

+ 486 - 488
pages/score/clockin.vue

@@ -1,500 +1,498 @@
 <template>
-	<view>
-		<view class="main_view">
-			<view class="status_bar" :style="status_bar_style"><!-- 这里是状态栏 --></view>
-			<view class="info_box">
-				<view class="left_box">
-					<view class="score_info">
-						<view class="score_title">当前积分</view>
-						<view class="score_current">{{scoreInfo.score}} </view>
-					</view>
-					<view class="wait_info">
-						<view class="wait_title">待入账积分</view>
-						<view class="wait_score">{{scoreInfo.wait_score?scoreInfo.wait_score:0}}</view>
-					</view>
-				</view>
-				<view class="right_box">
-					<navigator url="/pages/score/lottery" class="lottery_enter">
-						<image class="lottery_img"
-							src="https://mall.findit.ltd/uploads/images/default/lottery_record.png" mode=""></image>
-						<view class="lottery_text">点我抽奖</view>
-					</navigator>
-				</view>
-			</view>
-			<view class="clockin_box" v-if="clockinList.length > 0">
-				<view class="box_title">
-					<view class="left_icon" v-if="(this.listKey>0)" @click="leftClockin()"><uni-icons type="left"
-							size="20"></uni-icons></view>
-					{{isMark.finish_day?'已连续签到 '+isMark.finish_day+' 天':'连续签到奖励更丰厚'}}
-					<view class="right_icon" v-if="(this.listKey<(this.listLength-1))" @click="rightClockin()">
-						<uni-icons type="right" size="20"></uni-icons></view>
-				</view>
-				<view class="clockin_list">
-					<view class="clockin_item" :class="item.is_finish?'acitve':''"
-						v-for="(item,index) in clockinList[listKey]" :key="index">
-						<view class="give_coupon" v-if="item['coupon_id']">券</view>
-						<view class="what_day">{{item.what_day}}</view>
-						<view class="score_one">
-							<image class="score_icon" src="../../static/icon/score.png" mode=""></image>
-						</view>
-						<!--						<view class="score_tow" v-if="index == 2 ||  index == 4">
+  <view>
+    <view class="main_view">
+      <view class="status_bar" :style="status_bar_style"><!-- 这里是状态栏 --></view>
+      <view class="info_box">
+        <view class="left_box">
+          <view class="score_info">
+            <view class="score_title">当前积分</view>
+            <view class="score_current">{{ scoreInfo.score }} </view>
+          </view>
+          <view class="wait_info">
+            <view class="wait_title">待入账积分</view>
+            <view class="wait_score">{{ scoreInfo.wait_score ? scoreInfo.wait_score : 0 }}</view>
+          </view>
+        </view>
+        <view class="right_box">
+          <navigator url="/pages/score/lottery" class="lottery_enter">
+            <image class="lottery_img" src="https://mall.findit.ltd/uploads/images/default/lottery_record.png" mode=""></image>
+            <view class="lottery_text">点我抽奖</view>
+          </navigator>
+        </view>
+      </view>
+      <view class="clockin_box" v-if="clockinList.length > 0">
+        <view class="box_title">
+          <view class="left_icon" v-if="this.listKey > 0" @click="leftClockin()"><uni-icons type="left" size="20"></uni-icons></view>
+          {{ isMark.finish_day ? "已连续签到 " + isMark.finish_day + " 天" : "连续签到奖励更丰厚" }}
+          <view class="right_icon" v-if="this.listKey < this.listLength - 1" @click="rightClockin()"> <uni-icons type="right" size="20"></uni-icons></view>
+        </view>
+        <view class="clockin_list">
+          <view class="clockin_item" :class="item.is_finish ? 'acitve' : ''" v-for="(item, index) in clockinList[listKey]" :key="index">
+            <view class="give_coupon" v-if="item['coupon_id']">券</view>
+            <view class="what_day">{{ item.what_day }}</view>
+            <view class="score_one">
+              <image class="score_icon" src="../../static/icon/score.png" mode=""></image>
+            </view>
+            <!--						<view class="score_tow" v-if="index == 2 ||  index == 4">
 							<image class="score_icon" src="../../static/icon/score.png" mode=""></image>
 							<image class="score_icon" src="../../static/icon/score.png" mode=""></image>
 						</view>-->
-						<view class="give_score">+{{item.reward}}</view>
-					</view>
-				</view>
-				<button class="clockin_btn" :class="isMark.is_clockin?'active':''"
-					@click="toClockin()">{{isMark.is_clockin?'已签到':'签到'}}</button>
-				<navigator url="/pages/score/record" class="score_record">积分记录 &gt;</navigator>
-			</view>
-			<view class="clockin_box" v-else>
-				<view class="box_title">
-					暂无签到活动
-				</view>
-				<navigator url="/pages/score/record" class="score_record">积分记录 &gt;</navigator>
-			</view>
-		</view>
-	</view>
+            <view class="give_score">+{{ item.reward }}</view>
+          </view>
+        </view>
+        <button class="clockin_btn" :class="isMark.is_clockin ? 'active' : ''" @click="toClockin()">{{ isMark.is_clockin ? "已签到" : "签到" }}</button>
+        <navigator url="/pages/score/record" class="score_record">积分记录 &gt;</navigator>
+      </view>
+      <view class="clockin_box" v-else>
+        <view class="box_title"> 暂无签到活动 </view>
+        <navigator url="/pages/score/record" class="score_record">积分记录 &gt;</navigator>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				status_bar_style: {},
-				clockinList: [],
-				isMark: {
-					finish_day: 0,
-					is_clockin: 0,
-				},
-				scoreInfo: {
-					score: 0,
-					use_score: 0,
-					wait_score: 0,
-				},
-				isReqing: false,
-				listKey: 0,
-				listLength: 0,
-				active_id: 0,
-			}
-		},
-		onLoad() {
-			// #ifdef MP-WEIXIN
-			let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
-			this.status_bar_style = {
-				height: (menuButtonInfo.height) + "px",
-				"padding-top": menuButtonInfo.top + "px"
-			};
-			// #endif
-			// #ifdef MP-WEIXIN
-			//分享按钮
-			uni.showShareMenu({
-				withShareTicket: true,
-				menus: ['shareAppMessage', 'shareTimeline']
-			})
-			// #endif
-		},
-		onShareAppMessage(obj) {
-			// 获取分享信息
-			let shareList 	= getApp().globalData.shareList;
-			// 获取分享信息
-			let shareObj	= {
-								title: '药优惠 得积分 兑豪礼',
-								path: '/pages/score/clockin',
-								imageUrl:'',
-							};
-			// 循环列表
-			for ( let i in shareList ) {
-				if( shareList[i].pages == 'pages/score/clockin' ) {
-					shareObj.path  = shareList[i].path ? shareList[i].path : shareObj.path ;
-					shareObj.title  = shareList[i].title ? shareList[i].title : shareObj.title ;
-					shareObj.imageUrl  = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl ;
-				}
-			}
-			// 返回分享信息
-			return shareObj;
-		},
-		onShow() {
-			// 登录提示
-			if (!this.$checkAccess.alterLogin()) return;
-			// 请求打卡列表
-			this.getClockinList();
-			// 请求中,不允许刷新
-			if (this.isReqing) return;
-			// 设置请求中
-			this.isReqing = true;
-			// 请求列表
-			this.$http.request('/api/custom_score/get_info', this.requestParam).then((re) => {
-				// 设置非请求中
-				this.isReqing = false;
-				// 成功结果
-				if (re.code == 'success') {
-					this.scoreInfo = re.data;
-				}
-			});
-		},
-		methods: {
-			toClockin() {
-				// 如果已经打卡
-				if (this.isMark.is_clockin) return;
-				// 登录提示
-				if (!this.$checkAccess.alterLogin()) return;
-				if (this.active_id === 0) {
-					uni.showToast({
-						title: '暂无活动',
-						icon: "none"
-					});
-				}
-				// 请求中,不允许刷新
-				if (this.isReqing) return;
-				// 设置请求中
-				this.isReqing = true;
-				// 请求列表
-				this.$http.request('api/score_clockin/finish', {
-					'active_id': this.active_id
-				}, 'post').then((re) => {
-					// 设置非请求中
-					this.isReqing = false;
-					// 成功结果
-					if (re.code == 'success') {
-						// 赋值
-						this.isMark = re.data;
-						// 积分更新
-						this.scoreInfo.score = re.data.reward + this.scoreInfo.score;
-						// 更新打卡
-						for (let i in this.clockinList[this.listKey]) {
-							// 如果小于等于连续打卡天数,设置为打卡
-							if (this.clockinList[this.listKey][i].what_day <= this.isMark.finish_day) this.clockinList[this.listKey][i].is_finish = 1;
-						}
-					} else {
-						uni.showToast({
-							title: '打卡失败',
-							icon: "none"
-
-						})
-					}
-				});
-			},
-			getClockinList() {
-				// 请求列表
-				this.$http.request('api/score_clockin/get_list', this.requestParam).then((re) => {
-					// 成功结果
-					if (re.code == 'success') {
-						// 赋值
-						this.clockinList = re.data.list;
-						this.listLength = this.clockinList.length;
-						this.active_id = re.data.active_id;
-						// 赋值
-						this.isMark = re.data.is_mark;
-					}
-				});
-			},
-			leftClockin() {
-				if (this.listKey > 0) {
-					this.listKey = this.listKey - 1
-				}
-			},
-			rightClockin() {
-				this.listKey = this.listKey + 1
-			}
-		}
-	}
+export default {
+  data() {
+    return {
+      status_bar_style: {},
+      clockinList: [],
+      isMark: {
+        finish_day: 0,
+        is_clockin: 0,
+      },
+      scoreInfo: {
+        score: 0,
+        use_score: 0,
+        wait_score: 0,
+      },
+      isReqing: false,
+      listKey: 0,
+      listLength: 0,
+      active_id: 0,
+    };
+  },
+  onLoad() {
+    // #ifdef MP-WEIXIN
+    let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
+    this.status_bar_style = {
+      height: menuButtonInfo.height + "px",
+      "padding-top": menuButtonInfo.top + "px",
+    };
+    // #endif
+    // #ifdef MP-WEIXIN
+    //分享按钮
+    uni.showShareMenu({
+      withShareTicket: true,
+      menus: ["shareAppMessage", "shareTimeline"],
+    });
+    // #endif
+  },
+  onShareAppMessage(obj) {
+    // 获取分享信息
+    let shareList = getApp().globalData.shareList;
+    // 获取分享信息
+    let shareObj = {
+      title: "学生征订",
+      path: "/pages/score/clockin",
+      imageUrl: "",
+    };
+    // 循环列表
+    for (let i in shareList) {
+      if (shareList[i].pages == "pages/score/clockin") {
+        shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path;
+        shareObj.title = shareList[i].title ? shareList[i].title : shareObj.title;
+        shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl;
+      }
+    }
+    // 返回分享信息
+    return shareObj;
+  },
+  onShow() {
+    // 登录提示
+    if (!this.$checkAccess.alterLogin()) return;
+    // 请求打卡列表
+    this.getClockinList();
+    // 请求中,不允许刷新
+    if (this.isReqing) return;
+    // 设置请求中
+    this.isReqing = true;
+    // 请求列表
+    this.$http.request("/api/custom_score/get_info", this.requestParam).then((re) => {
+      // 设置非请求中
+      this.isReqing = false;
+      // 成功结果
+      if (re.code == "success") {
+        this.scoreInfo = re.data;
+      }
+    });
+  },
+  methods: {
+    toClockin() {
+      // 如果已经打卡
+      if (this.isMark.is_clockin) return;
+      // 登录提示
+      if (!this.$checkAccess.alterLogin()) return;
+      if (this.active_id === 0) {
+        uni.showToast({
+          title: "暂无活动",
+          icon: "none",
+        });
+      }
+      // 请求中,不允许刷新
+      if (this.isReqing) return;
+      // 设置请求中
+      this.isReqing = true;
+      // 请求列表
+      this.$http
+        .request(
+          "api/score_clockin/finish",
+          {
+            active_id: this.active_id,
+          },
+          "post"
+        )
+        .then((re) => {
+          // 设置非请求中
+          this.isReqing = false;
+          // 成功结果
+          if (re.code == "success") {
+            // 赋值
+            this.isMark = re.data;
+            // 积分更新
+            this.scoreInfo.score = re.data.reward + this.scoreInfo.score;
+            // 更新打卡
+            for (let i in this.clockinList[this.listKey]) {
+              // 如果小于等于连续打卡天数,设置为打卡
+              if (this.clockinList[this.listKey][i].what_day <= this.isMark.finish_day) this.clockinList[this.listKey][i].is_finish = 1;
+            }
+          } else {
+            uni.showToast({
+              title: "打卡失败",
+              icon: "none",
+            });
+          }
+        });
+    },
+    getClockinList() {
+      // 请求列表
+      this.$http.request("api/score_clockin/get_list", this.requestParam).then((re) => {
+        // 成功结果
+        if (re.code == "success") {
+          // 赋值
+          this.clockinList = re.data.list;
+          this.listLength = this.clockinList.length;
+          this.active_id = re.data.active_id;
+          // 赋值
+          this.isMark = re.data.is_mark;
+        }
+      });
+    },
+    leftClockin() {
+      if (this.listKey > 0) {
+        this.listKey = this.listKey - 1;
+      }
+    },
+    rightClockin() {
+      this.listKey = this.listKey + 1;
+    },
+  },
+};
 </script>
 
 <style lang="less">
-	page {
-		background-color: #FFFFFF;
-	}
-
-	.main_view {
-		display: block;
-		height: 1000rpx;
-		background: linear-gradient(to bottom, #FC335F 0%, #FB7224 50%, #FFFFFF 100%);
-
-		.status_bar {
-			width: 100%;
-			height: 64rpx;
-			display: block;
-			padding-top: var(--status-bar-height);
-		}
-
-		.info_box {
-			display: block;
-			overflow: hidden;
-
-			.left_box {
-				float: left;
-				width: 450rpx;
-
-				.score_info {
-					color: #FFFFFF;
-					overflow: hidden;
-					padding: 0rpx 35rpx;
-
-					.score_title {
-						width: 240rpx;
-						height: 60rpx;
-						display: block;
-						font-size: 26rpx;
-						line-height: 60rpx;
-					}
-
-					.score_current {
-						width: 240rpx;
-						height: 80rpx;
-						display: block;
-						font-size: 66rpx;
-						line-height: 80rpx;
-					}
-				}
-
-				.wait_info {
-					color: #FFFFFF;
-					display: block;
-					overflow: hidden;
-					padding: 0rpx 35rpx;
-					margin-top: 20rpx;
-
-					.wait_title {
-						width: 240rpx;
-						height: 40rpx;
-						display: block;
-						font-size: 24rpx;
-						line-height: 40rpx;
-					}
-
-					.wait_score {
-						width: 240rpx;
-						height: 60rpx;
-						display: block;
-						font-size: 36rpx;
-						line-height: 60rpx;
-					}
-				}
-			}
-
-			.right_box {
-				float: right;
-				overflow: hidden;
-				margin-top: 60rpx;
-				margin-right: 35rpx;
-
-				.lottery_enter {
-					display: block;
-					overflow: hidden;
-					text-align: center;
-
-					.lottery_img {
-						width: 150rpx;
-						height: 150rpx;
-						display: block;
-						margin: 0 auto;
-					}
-
-					.lottery_text {
-						color: #FFFFFF;
-						height: 60rpx;
-						font-size: 28rpx;
-						line-height: 60rpx;
-					}
-				}
-			}
-		}
-
-		.clockin_box {
-			z-index: 9;
-			display: block;
-			width: 700rpx;
-			margin: 0rpx auto;
-			position: relative;
-			border-radius: 40rpx;
-			background-color: #FFFFFF;
-			box-shadow: 5rpx 5rpx 2rpx 0rpx #DDDDDD;
-
-			.box_title {
-				height: 80rpx;
-				color: #999999;
-				text-align: center;
-				line-height: 80rpx;
-
-				.left_icon {
-					float: left;
-					padding-left: 20rpx;
-				}
-
-				.right_icon {
-					float: right;
-					padding-right: 20rpx;
-				}
-			}
-
-			.clockin_list {
-				display: block;
-				overflow: hidden;
-				width: 100%;
-				padding-top: 25rpx;
-
-				.clockin_item {
-					float: left;
-					position: relative;
-					width: 70rpx;
-					height: 165rpx;
-					text-align: center;
-					margin-left: 25rpx;
-					border-radius: 20rpx;
-					margin-bottom: 20rpx;
-					background-color: #F8F8F8;
-
-					.what_day {
-						display: block;
-						height: 40rpx;
-						font-size: 24rpx;
-						line-height: 60rpx;
-					}
-
-					.score_one {
-						display: block;
-						height: 60rpx;
-						margin: 10rpx auto;
-						position: relative;
-
-						.score_icon {
-							display: block;
-							width: 60rpx;
-							height: 60rpx;
-							margin: 0rpx auto;
-						}
-					}
-
-					.score_tow {
-						display: block;
-						height: 80rpx;
-						margin: 10rpx auto;
-						position: relative;
-
-						.score_icon {
-							display: block;
-							width: 80rpx;
-							height: 80rpx;
-							margin: 0rpx auto;
-						}
-
-						.score_icon:nth-child(1) {
-							top: 0rpx;
-							left: 10rpx;
-							width: 80rpx;
-							height: 80rpx;
-							position: absolute;
-						}
-
-						.score_icon:nth-child(2) {
-							top: 0rpx;
-							left: 55rpx;
-							width: 80rpx;
-							height: 80rpx;
-							position: absolute;
-						}
-					}
-
-					.score_the {
-						width: 200rpx;
-						display: block;
-						height: 100rpx;
-						margin: 10rpx auto;
-						position: relative;
-
-						.score_icon {
-							display: block;
-							width: 80rpx;
-							height: 80rpx;
-							margin: 0rpx auto;
-						}
-
-						.score_icon:nth-child(1) {
-							top: 15rpx;
-							left: 20rpx;
-							width: 80rpx;
-							height: 80rpx;
-							position: absolute;
-						}
-
-						.score_icon:nth-child(2) {
-							top: 15rpx;
-							left: 95rpx;
-							width: 80rpx;
-							height: 80rpx;
-							position: absolute;
-						}
-
-						.score_icon:nth-child(3) {
-							top: 0rpx;
-							left: 60rpx;
-							width: 80rpx;
-							height: 80rpx;
-							position: absolute;
-						}
-					}
-
-					.give_score {
-						display: block;
-						height: 30rpx;
-						font-size: 24rpx;
-						line-height: 40rpx;
-					}
-
-					.give_coupon {
-						position: absolute;
-						font-size: 20rpx;
-						padding: 2px 5px;
-						background-color: #f00;
-						color: #fff;
-						border-radius: 6px;
-						display: inline-block;
-						text-align: center;
-						right: -15rpx;
-						top: -15rpx;
-					}
-				}
-
-				/*.clockin_item:nth-child(7){
+page {
+  background-color: #ffffff;
+}
+
+.main_view {
+  display: block;
+  height: 1000rpx;
+  background: linear-gradient(to bottom, #fc335f 0%, #fb7224 50%, #ffffff 100%);
+
+  .status_bar {
+    width: 100%;
+    height: 64rpx;
+    display: block;
+    padding-top: var(--status-bar-height);
+  }
+
+  .info_box {
+    display: block;
+    overflow: hidden;
+
+    .left_box {
+      float: left;
+      width: 450rpx;
+
+      .score_info {
+        color: #ffffff;
+        overflow: hidden;
+        padding: 0rpx 35rpx;
+
+        .score_title {
+          width: 240rpx;
+          height: 60rpx;
+          display: block;
+          font-size: 26rpx;
+          line-height: 60rpx;
+        }
+
+        .score_current {
+          width: 240rpx;
+          height: 80rpx;
+          display: block;
+          font-size: 66rpx;
+          line-height: 80rpx;
+        }
+      }
+
+      .wait_info {
+        color: #ffffff;
+        display: block;
+        overflow: hidden;
+        padding: 0rpx 35rpx;
+        margin-top: 20rpx;
+
+        .wait_title {
+          width: 240rpx;
+          height: 40rpx;
+          display: block;
+          font-size: 24rpx;
+          line-height: 40rpx;
+        }
+
+        .wait_score {
+          width: 240rpx;
+          height: 60rpx;
+          display: block;
+          font-size: 36rpx;
+          line-height: 60rpx;
+        }
+      }
+    }
+
+    .right_box {
+      float: right;
+      overflow: hidden;
+      margin-top: 60rpx;
+      margin-right: 35rpx;
+
+      .lottery_enter {
+        display: block;
+        overflow: hidden;
+        text-align: center;
+
+        .lottery_img {
+          width: 150rpx;
+          height: 150rpx;
+          display: block;
+          margin: 0 auto;
+        }
+
+        .lottery_text {
+          color: #ffffff;
+          height: 60rpx;
+          font-size: 28rpx;
+          line-height: 60rpx;
+        }
+      }
+    }
+  }
+
+  .clockin_box {
+    z-index: 9;
+    display: block;
+    width: 700rpx;
+    margin: 0rpx auto;
+    position: relative;
+    border-radius: 40rpx;
+    background-color: #ffffff;
+    box-shadow: 5rpx 5rpx 2rpx 0rpx #dddddd;
+
+    .box_title {
+      height: 80rpx;
+      color: #999999;
+      text-align: center;
+      line-height: 80rpx;
+
+      .left_icon {
+        float: left;
+        padding-left: 20rpx;
+      }
+
+      .right_icon {
+        float: right;
+        padding-right: 20rpx;
+      }
+    }
+
+    .clockin_list {
+      display: block;
+      overflow: hidden;
+      width: 100%;
+      padding-top: 25rpx;
+
+      .clockin_item {
+        float: left;
+        position: relative;
+        width: 70rpx;
+        height: 165rpx;
+        text-align: center;
+        margin-left: 25rpx;
+        border-radius: 20rpx;
+        margin-bottom: 20rpx;
+        background-color: #f8f8f8;
+
+        .what_day {
+          display: block;
+          height: 40rpx;
+          font-size: 24rpx;
+          line-height: 60rpx;
+        }
+
+        .score_one {
+          display: block;
+          height: 60rpx;
+          margin: 10rpx auto;
+          position: relative;
+
+          .score_icon {
+            display: block;
+            width: 60rpx;
+            height: 60rpx;
+            margin: 0rpx auto;
+          }
+        }
+
+        .score_tow {
+          display: block;
+          height: 80rpx;
+          margin: 10rpx auto;
+          position: relative;
+
+          .score_icon {
+            display: block;
+            width: 80rpx;
+            height: 80rpx;
+            margin: 0rpx auto;
+          }
+
+          .score_icon:nth-child(1) {
+            top: 0rpx;
+            left: 10rpx;
+            width: 80rpx;
+            height: 80rpx;
+            position: absolute;
+          }
+
+          .score_icon:nth-child(2) {
+            top: 0rpx;
+            left: 55rpx;
+            width: 80rpx;
+            height: 80rpx;
+            position: absolute;
+          }
+        }
+
+        .score_the {
+          width: 200rpx;
+          display: block;
+          height: 100rpx;
+          margin: 10rpx auto;
+          position: relative;
+
+          .score_icon {
+            display: block;
+            width: 80rpx;
+            height: 80rpx;
+            margin: 0rpx auto;
+          }
+
+          .score_icon:nth-child(1) {
+            top: 15rpx;
+            left: 20rpx;
+            width: 80rpx;
+            height: 80rpx;
+            position: absolute;
+          }
+
+          .score_icon:nth-child(2) {
+            top: 15rpx;
+            left: 95rpx;
+            width: 80rpx;
+            height: 80rpx;
+            position: absolute;
+          }
+
+          .score_icon:nth-child(3) {
+            top: 0rpx;
+            left: 60rpx;
+            width: 80rpx;
+            height: 80rpx;
+            position: absolute;
+          }
+        }
+
+        .give_score {
+          display: block;
+          height: 30rpx;
+          font-size: 24rpx;
+          line-height: 40rpx;
+        }
+
+        .give_coupon {
+          position: absolute;
+          font-size: 20rpx;
+          padding: 2px 5px;
+          background-color: #f00;
+          color: #fff;
+          border-radius: 6px;
+          display: inline-block;
+          text-align: center;
+          right: -15rpx;
+          top: -15rpx;
+        }
+      }
+
+      /*.clockin_item:nth-child(7){
 					width: 315rpx;
 				}*/
-				.clockin_item.acitve {
-					color: #FFFFFF;
-					background-color: #E03519;
-				}
-			}
-
-			.clockin_btn {
-				width: 660rpx;
-				color: #FFFFFF;
-				font-size: 30rpx;
-				margin-top: 20rpx;
-				padding: 0rpx 0rpx;
-				border-radius: 60rpx;
-				background-color: #E03519;
-				border: 0rpx solid transparent;
-			}
-
-			.clockin_btn.active {
-				color: #FFFFFF;
-				background-color: #AAAAAA;
-			}
-
-			.clockin_btn::after {
-				border: 0rpx solid transparent;
-			}
-
-			.score_record {
-				height: 60rpx;
-				display: block;
-				color: #999999;
-				font-size: 24rpx;
-				margin-top: 20rpx;
-				text-align: center;
-				line-height: 80rpx;
-			}
-		}
-	}
-</style>
+      .clockin_item.acitve {
+        color: #ffffff;
+        background-color: #e03519;
+      }
+    }
+
+    .clockin_btn {
+      width: 660rpx;
+      color: #ffffff;
+      font-size: 30rpx;
+      margin-top: 20rpx;
+      padding: 0rpx 0rpx;
+      border-radius: 60rpx;
+      background-color: #e03519;
+      border: 0rpx solid transparent;
+    }
+
+    .clockin_btn.active {
+      color: #ffffff;
+      background-color: #aaaaaa;
+    }
+
+    .clockin_btn::after {
+      border: 0rpx solid transparent;
+    }
+
+    .score_record {
+      height: 60rpx;
+      display: block;
+      color: #999999;
+      font-size: 24rpx;
+      margin-top: 20rpx;
+      text-align: center;
+      line-height: 80rpx;
+    }
+  }
+}
+</style>

+ 291 - 289
pages/score/index.vue

@@ -1,297 +1,299 @@
 <template>
-	<view>
-		<view class="product_box">
-			<view class="to_bottom" v-if="!productList.length"> -----还没有积分产品-----</view>
-			<view class="product_list" >
-				<!-- Vue3 项目部分小程序端事件延迟或调用失败 在执行事件的元素上添加 data-eventsync="true" 属性以解决此问题 -->
-				<view @click="toDetail(item)" data-eventsync="true" class="product_item" v-for="(item,index) in productList" :key="index" >
-					<image class="product_image" :src="item.thumb" mode=""></image>
-					<view class="product_name"><text>{{item.name}}</text></view>
-					<view class="stock_price">
-						<view class="product_price">
-							<text>{{item.score}} 积分</text>
-						</view>
-					</view>
-				</view>
-			</view>
-		</view>
-		<view class="search_fixed" >
-			<view class="search_box">
-				<input class="search_input" type="text" v-model="requestParam.name" @input="searchChange" placeholder="请输入产品名称搜索" />
-				<button class="search_btn" @click.stop="searchOpen()"  data-eventsync="true"> 搜索</button>
-			</view>
-		</view>
-		<view class="to_bottom" v-if="isLast"> -----到底了-----</view>
-	</view>
+  <view>
+    <view class="product_box">
+      <view class="to_bottom" v-if="!productList.length"> -----还没有积分产品-----</view>
+      <view class="product_list">
+        <!-- Vue3 项目部分小程序端事件延迟或调用失败 在执行事件的元素上添加 data-eventsync="true" 属性以解决此问题 -->
+        <view @click="toDetail(item)" data-eventsync="true" class="product_item" v-for="(item, index) in productList" :key="index">
+          <image class="product_image" :src="item.thumb" mode=""></image>
+          <view class="product_name"
+            ><text>{{ item.name }}</text></view
+          >
+          <view class="stock_price">
+            <view class="product_price">
+              <text>{{ item.score }} 积分</text>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="search_fixed">
+      <view class="search_box">
+        <input class="search_input" type="text" v-model="requestParam.name" @input="searchChange" placeholder="请输入产品名称搜索" />
+        <button class="search_btn" @click.stop="searchOpen()" data-eventsync="true">搜索</button>
+      </view>
+    </view>
+    <view class="to_bottom" v-if="isLast"> -----到底了-----</view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				// 产品列表
-				productList:[],
-				// 请求参数
-				requestParam:{
-					name:"",
-					page:1,
-				},
-				// 是否最后一页
-				isLast:false,
-				// 是否请求中
-				isReqing:false,
-			}
-		},
-		onLoad() {
-			// #ifdef MP-WEIXIN
-			//分享按钮
-			uni.showShareMenu({
-				withShareTicket: true,
-				menus: ['shareAppMessage', 'shareTimeline']
-			})
-			// #endif
-		},
-		onShareAppMessage(obj) {
-			// 获取分享信息
-			let shareList 	= getApp().globalData.shareList;
-			// 获取分享信息
-			let shareObj	= {
-								title: '药优惠 得积分 兑豪礼',
-								path: '/pages/score/index',
-								imageUrl:'',
-							};
-			// 循环列表
-			for ( let i in shareList ) {
-				if( shareList[i].pages == 'pages/score/index' ) {
-					shareObj.path  = shareList[i].path ? shareList[i].path : shareObj.path ;
-					shareObj.title  = shareList[i].title ? shareList[i].title : shareObj.title ;
-					shareObj.imageUrl  = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl ;
-				}
-			}
-			// 返回分享信息
-			return shareObj;
-		},
-		onShow() {
-			// 没有数据的话,或者请求中,不允许刷新
-			if( this.isReqing )		return ;
-			// 请求参数
-			this.requestParam.name	= "";
-			// 请求参数
-			this.requestParam.page	= 1;
-			// 是否是最后一页
-			this.isLast			 	= false;
-			// 设置请求中
-			this.isReqing			= true;
-			// 请求
-			this.$http.request('api/score_product/get_list',this.requestParam).then((re)=>{
-				// 设置非请求中
-				this.isReqing		= false;
-				// 成功结果
-				if( re.code == 'success' ){
-					if(re.data.last_page <= this.requestParam.page ) this.isLast = true;
-					this.productList = re.data.data;
-				}
-			});
-		},
-		onPullDownRefresh() {
-			// 如果请求中,不允许请求,
-			if( this.isReqing )		return uni.stopPullDownRefresh();
-			// 初始化页码为1
-			this.requestParam.page	= 1;
-			// 是否是最后一页
-			this.isLast			 	= false;
-			// 设置请求中
-			this.isReqing			= true;
-			// 请求列表
-			this.$http.request('api/score_product/get_list',this.requestParam).then((re)=>{
-				// 设置非请求中
-				this.isReqing		= false;
-				// 成功结果
-				if( re.code == 'success' ){
-					if(re.data.last_page <= this.requestParam.page ) this.isLast = true;
-					this.productList = re.data.data;
-				}
-			});
-			uni.stopPullDownRefresh();
-		},
-		onReachBottom() {
-			// 如果页码是0,避免第一页重复
-			if( this.requestParam.page < 1 ) return;
-			// 最后一页不再请求
-			if( this.isLast ) 	return;
-			// 请求中,不再请求
-			if( this.isReqing ) return;
-			// 增加一页
-			this.requestParam.page = this.requestParam.page+1;
-			// 设置请求中
-			this.isReqing			= true;
-			// 请求列表
-			this.$http.request('api/score_product/get_list',this.requestParam).then((re)=>{
-				// 设置非请求中
-				this.isReqing		= false;
-				// 成功结果
-				if( re.code == 'success' ){
-					// 最后一页
-					if(re.data.last_page <= this.requestParam.page ) this.isLast = true;
-					// 追加数据
-					this.productList.push(...re.data.data);
-				}
-			});
-		},
-		methods: {
-			searchChange(e){
-				// 如果没有搜索词
-				if( !this.requestParam.name ){
-					this.searchOpen();
-				}
-			},
-			searchOpen(){
-				// 请求中,不再请求
-				if( this.isReqing ) 	return;
-				// 是否是最后一页
-				this.isLast			 	= false;
-				// 初始化页码为1
-				this.requestParam.page	= 1;
-				// 设置请求中
-				this.isReqing			= true;
-				// 请求列表
-				this.$http.request('api/score_product/get_list',this.requestParam).then((re)=>{
-					// 设置非请求中
-					this.isReqing		= false;
-					// 成功结果
-					if( re.code == 'success' ){
-						this.productList = re.data.data;
-						if( re.data.data.length && re.data.last_page >= this.requestParam.page ) this.isLast = true;
-					}
-				});
-			},
-			toDetail(item){
-				uni.navigateTo({
-					url:"/pages/score/product?id="+item.id,
-				})
-			}
-		}
-	}
+export default {
+  data() {
+    return {
+      // 产品列表
+      productList: [],
+      // 请求参数
+      requestParam: {
+        name: "",
+        page: 1,
+      },
+      // 是否最后一页
+      isLast: false,
+      // 是否请求中
+      isReqing: false,
+    };
+  },
+  onLoad() {
+    // #ifdef MP-WEIXIN
+    //分享按钮
+    uni.showShareMenu({
+      withShareTicket: true,
+      menus: ["shareAppMessage", "shareTimeline"],
+    });
+    // #endif
+  },
+  onShareAppMessage(obj) {
+    // 获取分享信息
+    let shareList = getApp().globalData.shareList;
+    // 获取分享信息
+    let shareObj = {
+      title: "学生征订",
+      path: "/pages/score/index",
+      imageUrl: "",
+    };
+    // 循环列表
+    for (let i in shareList) {
+      if (shareList[i].pages == "pages/score/index") {
+        shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path;
+        shareObj.title = shareList[i].title ? shareList[i].title : shareObj.title;
+        shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl;
+      }
+    }
+    // 返回分享信息
+    return shareObj;
+  },
+  onShow() {
+    // 没有数据的话,或者请求中,不允许刷新
+    if (this.isReqing) return;
+    // 请求参数
+    this.requestParam.name = "";
+    // 请求参数
+    this.requestParam.page = 1;
+    // 是否是最后一页
+    this.isLast = false;
+    // 设置请求中
+    this.isReqing = true;
+    // 请求
+    this.$http.request("api/score_product/get_list", this.requestParam).then((re) => {
+      // 设置非请求中
+      this.isReqing = false;
+      // 成功结果
+      if (re.code == "success") {
+        if (re.data.last_page <= this.requestParam.page) this.isLast = true;
+        this.productList = re.data.data;
+      }
+    });
+  },
+  onPullDownRefresh() {
+    // 如果请求中,不允许请求,
+    if (this.isReqing) return uni.stopPullDownRefresh();
+    // 初始化页码为1
+    this.requestParam.page = 1;
+    // 是否是最后一页
+    this.isLast = false;
+    // 设置请求中
+    this.isReqing = true;
+    // 请求列表
+    this.$http.request("api/score_product/get_list", this.requestParam).then((re) => {
+      // 设置非请求中
+      this.isReqing = false;
+      // 成功结果
+      if (re.code == "success") {
+        if (re.data.last_page <= this.requestParam.page) this.isLast = true;
+        this.productList = re.data.data;
+      }
+    });
+    uni.stopPullDownRefresh();
+  },
+  onReachBottom() {
+    // 如果页码是0,避免第一页重复
+    if (this.requestParam.page < 1) return;
+    // 最后一页不再请求
+    if (this.isLast) return;
+    // 请求中,不再请求
+    if (this.isReqing) return;
+    // 增加一页
+    this.requestParam.page = this.requestParam.page + 1;
+    // 设置请求中
+    this.isReqing = true;
+    // 请求列表
+    this.$http.request("api/score_product/get_list", this.requestParam).then((re) => {
+      // 设置非请求中
+      this.isReqing = false;
+      // 成功结果
+      if (re.code == "success") {
+        // 最后一页
+        if (re.data.last_page <= this.requestParam.page) this.isLast = true;
+        // 追加数据
+        this.productList.push(...re.data.data);
+      }
+    });
+  },
+  methods: {
+    searchChange(e) {
+      // 如果没有搜索词
+      if (!this.requestParam.name) {
+        this.searchOpen();
+      }
+    },
+    searchOpen() {
+      // 请求中,不再请求
+      if (this.isReqing) return;
+      // 是否是最后一页
+      this.isLast = false;
+      // 初始化页码为1
+      this.requestParam.page = 1;
+      // 设置请求中
+      this.isReqing = true;
+      // 请求列表
+      this.$http.request("api/score_product/get_list", this.requestParam).then((re) => {
+        // 设置非请求中
+        this.isReqing = false;
+        // 成功结果
+        if (re.code == "success") {
+          this.productList = re.data.data;
+          if (re.data.data.length && re.data.last_page >= this.requestParam.page) this.isLast = true;
+        }
+      });
+    },
+    toDetail(item) {
+      uni.navigateTo({
+        url: "/pages/score/product?id=" + item.id,
+      });
+    },
+  },
+};
 </script>
 
 <style lang="less">
-	.search_fixed{
-		top: var(--window-top);
-		left: 0rpx;
-		width: 750rpx;
-		display: block;
-		position: fixed;
-		margin: 0rpx auto;
-		padding: 20rpx 0rpx;
-		background-color: #FFFFFF;
-		.search_box{
-			width: 750rpx;
-			height: 60rpx;
-			display: block;
-			position: relative;
-			.search_input{
-				z-index: 0;
-				width: 590rpx;
-				height: 56rpx;
-				display: block;
-				font-size: 24rpx;
-				position: relative;
-				border-top-left-radius: 40rpx;
-				border-bottom-left-radius: 40rpx;
-				padding-left: 20rpx;
-				margin-left: 35rpx;
-				border: 2rpx solid #dddddd;
-			}
-			.search_btn{
-				top: 0rpx;
-				z-index: 9;
-				left: 610rpx;
-				color: #FFFFFF;
-				position: absolute;
-				display: block;
-				width: 120rpx;
-				height: 60rpx;
-				font-size: 24rpx;
-				margin: 0rpx 0rpx;
-				padding: 0rpx 0rpx;
-				line-height: 60rpx;
-				border-radius: 40rpx;
-				background-color: #E03519;
-			}
-		}
-	}
-	.product_box{
-		display: block;
-		overflow: hidden;
-		margin: 0rpx auto;
-		margin-top: 120rpx;
-		padding: 0rpx 35rpx;
-		.product_list{
-			display: block;
-			overflow: hidden;
-			margin: 0rpx auto;
-			.product_item{
-				float: left;
-				width: 320rpx;
-				height: 490rpx;
-				display: block;
-				overflow: hidden;
-				margin: 20rpx 0rpx;
-				margin-right: 40rpx;
-				background-color: #FFFFFF;
-				border-radius: 20rpx;
-				.product_image{
-					width: 320rpx;
-					height: 320rpx;
-				}
-				.product_name{
-					height: 80rpx;
-					font-size: 30rpx;
-					line-height: 40rpx;
-					overflow: hidden;
-					margin: 10rpx 0rpx;
-					padding: 0rpx 10rpx;
-					text-overflow: ellipsis;
-				}
-				.product_spec{
-					height: 30rpx;
-					color: #999999;
-					font-size: 24rpx;
-					line-height: 30rpx;
-					padding: 0rpx 10rpx;
-					overflow: hidden;
-					white-space: nowrap;
-					text-overflow: ellipsis;
-				}
-				.stock_price{
-					color: #dddddd;
-					font-size: 20rpx;
-					overflow: hidden;
-					line-height: 30rpx;
-					padding: 0rpx 10rpx;
-					.product_price{
-						float: left;
-						color: red;
-						font-size: 30rpx;
-						line-height: 60rpx;
-						.product_market{
-							font-size: 24rpx;
-							color: #999999;
-							line-height: 30rpx;
-							vertical-align: top;
-							text-decoration: line-through;
-						}
-					}
-					.product_stock{
-						float: right;
-						font-size: 20rpx;
-						line-height: 60rpx;
-					}
-				}
-			}
-			.product_item:nth-child(even){
-				margin-right: 0rpx;
-			}
-		}
-	}
+.search_fixed {
+  top: var(--window-top);
+  left: 0rpx;
+  width: 750rpx;
+  display: block;
+  position: fixed;
+  margin: 0rpx auto;
+  padding: 20rpx 0rpx;
+  background-color: #ffffff;
+  .search_box {
+    width: 750rpx;
+    height: 60rpx;
+    display: block;
+    position: relative;
+    .search_input {
+      z-index: 0;
+      width: 590rpx;
+      height: 56rpx;
+      display: block;
+      font-size: 24rpx;
+      position: relative;
+      border-top-left-radius: 40rpx;
+      border-bottom-left-radius: 40rpx;
+      padding-left: 20rpx;
+      margin-left: 35rpx;
+      border: 2rpx solid #dddddd;
+    }
+    .search_btn {
+      top: 0rpx;
+      z-index: 9;
+      left: 610rpx;
+      color: #ffffff;
+      position: absolute;
+      display: block;
+      width: 120rpx;
+      height: 60rpx;
+      font-size: 24rpx;
+      margin: 0rpx 0rpx;
+      padding: 0rpx 0rpx;
+      line-height: 60rpx;
+      border-radius: 40rpx;
+      background-color: #e03519;
+    }
+  }
+}
+.product_box {
+  display: block;
+  overflow: hidden;
+  margin: 0rpx auto;
+  margin-top: 120rpx;
+  padding: 0rpx 35rpx;
+  .product_list {
+    display: block;
+    overflow: hidden;
+    margin: 0rpx auto;
+    .product_item {
+      float: left;
+      width: 320rpx;
+      height: 490rpx;
+      display: block;
+      overflow: hidden;
+      margin: 20rpx 0rpx;
+      margin-right: 40rpx;
+      background-color: #ffffff;
+      border-radius: 20rpx;
+      .product_image {
+        width: 320rpx;
+        height: 320rpx;
+      }
+      .product_name {
+        height: 80rpx;
+        font-size: 30rpx;
+        line-height: 40rpx;
+        overflow: hidden;
+        margin: 10rpx 0rpx;
+        padding: 0rpx 10rpx;
+        text-overflow: ellipsis;
+      }
+      .product_spec {
+        height: 30rpx;
+        color: #999999;
+        font-size: 24rpx;
+        line-height: 30rpx;
+        padding: 0rpx 10rpx;
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+      }
+      .stock_price {
+        color: #dddddd;
+        font-size: 20rpx;
+        overflow: hidden;
+        line-height: 30rpx;
+        padding: 0rpx 10rpx;
+        .product_price {
+          float: left;
+          color: red;
+          font-size: 30rpx;
+          line-height: 60rpx;
+          .product_market {
+            font-size: 24rpx;
+            color: #999999;
+            line-height: 30rpx;
+            vertical-align: top;
+            text-decoration: line-through;
+          }
+        }
+        .product_stock {
+          float: right;
+          font-size: 20rpx;
+          line-height: 60rpx;
+        }
+      }
+    }
+    .product_item:nth-child(even) {
+      margin-right: 0rpx;
+    }
+  }
+}
 </style>

+ 632 - 625
pages/score/lottery.vue

@@ -1,633 +1,640 @@
 <template>
-	<view>
-		<view class="lottery_box" :style="height">
-			<view class="lottery_time" v-if="lotteryInfo.id">活动时间:{{lotteryInfo.start_date}} ~ {{lotteryInfo.end_date}}</view>
-			<view class="lottery_info">
-				<image class="lottery_logo" v-if="lotteryInfo.logo" :src="lotteryInfo.logo" mode="widthFix"></image>
-				<button class="lottery_rule_btn" @click="showRule">活动规则</button>
-			</view>
-			<l-dialer :customStyle="'width: 500rpx;height: 500rpx;margin: 0rpx auto;'" @click="onClick" dial-style="color: rgba(60,48,158,0.7); padding: 32rpx;background-image: url(https://mall.findit.ltd/uploads/images/default/lottery_bg.png)" :prizeList="prizeList" :turns="5" :duration="5" @done="onDone" ref="dialer" />
-			<view class="record_box">
-				<view class="score_info">
-					<view class="custom_score">当前积分:{{scoreInfo.score}}</view>
-					<view class="need_score" v-if="lotteryInfo.id" >每次抽奖消耗{{lotteryInfo.need_score}}积分</view>
-					<view class="need_score" v-if="!lotteryInfo.id" >暂无可参与的活动</view>
-				</view>
-				<button class="lottery_record" @click="showRecord" v-if="lotteryInfo.id">
-					<image class="lottery_record_img" src="https://mall.findit.ltd/uploads/images/default/lottery_record.png" mode=""></image>
-					<text class="lottery_record_text">中奖记录</text>
-				</button>
-			</view>
-		</view>
-		<uni-popup ref="lotteryRule" type="center">
-			<view class="lottery_rule_box">
-				<view class="lottery_rule_title">
-					<text>活动规则</text>
-					<view class="close_btn" @click="closeRule"> X </view>
-				</view>
-				<scroll-view class="lottery_rule_info" scroll-y="true" >
-					<rich-text :nodes="lotteryInfo.rule" class="rich_text"></rich-text>
-				</scroll-view>
-			</view>
-		</uni-popup>
-		<uni-popup ref="lotteryRecord" type="bottom">
-			<view class="lottery_record_box">
-				<view class="lottery_record_title">
-					<text>我的奖品</text>
-					<view class="close_btn" @click="closeRecord"> X </view>
-				</view>
-				<view class="lottery_record_none" v-if="!recordList.length">这里还是空的哦~</view>
-				<scroll-view class="lottery_record_list" scroll-y="true" >
-					<view class="lottery_record_item" v-for="(item,index) in recordList" :key="index">
-						<view class="reward_time">{{item.insert_time}}</view>
-						<view class="reward_name">{{item.reward_name}}</view>
-						<view class="reward_state" v-if="item.status">{{item.state}}</view>
-						<view class="reward_state" v-if="!item.status" @click="openAddr(index)">{{item.state}}</view>
-					</view>
-				</scroll-view>
-			</view>
-		</uni-popup>
-		<uni-popup ref="addrPopup" type="bottom" class="popup" background-color="#FFFFFF" >
-			<view class="popup_title">收货地址 <navigator url="/pages/addr/index?notify=addr" class="to_addr_page">管理</navigator> </view>
-			<view class="addr_list">
-				<view class="addr_item" v-for="(item,index) in addrList" :key="index" @click="checkedAddrItem(item)">
-					<view class="radio_label">
-						<image class="radio_icon" :src="item.id == checkedAddr.id? '../../static/icon/radioed.png' : '../../static/icon/radio.png'" ></image> 
-					</view>
-					<view class="contact_user">
-						<text class="contact_name">{{item.contact_name}}</text>
-						<text class="contact_phone">{{item.contact_phone}}</text>
-						<text class="contact_default" v-if="item.is_default">默认</text>
-						<text class="contact_shop">{{item.contact_shop}}</text>
-					</view>
-					<view class="contact_addr">
-						{{item.contact_province}} {{item.contact_city}} {{item.contact_area}} {{item.contact_addr}}
-					</view>
-				</view>
-			</view>
-			<view class="create_box">
-				<navigator url="/pages/addr/index?notify=addr&type=create" class="create_addr"  >新建收货地址</navigator>
-			</view>
-		</uni-popup>
-	</view>
+  <view>
+    <view class="lottery_box" :style="height">
+      <view class="lottery_time" v-if="lotteryInfo.id">活动时间:{{ lotteryInfo.start_date }} ~ {{ lotteryInfo.end_date }}</view>
+      <view class="lottery_info">
+        <image class="lottery_logo" v-if="lotteryInfo.logo" :src="lotteryInfo.logo" mode="widthFix"></image>
+        <button class="lottery_rule_btn" @click="showRule">活动规则</button>
+      </view>
+      <l-dialer
+        :customStyle="'width: 500rpx;height: 500rpx;margin: 0rpx auto;'"
+        @click="onClick"
+        dial-style="color: rgba(60,48,158,0.7); padding: 32rpx;background-image: url(https://mall.findit.ltd/uploads/images/default/lottery_bg.png)"
+        :prizeList="prizeList"
+        :turns="5"
+        :duration="5"
+        @done="onDone"
+        ref="dialer"
+      />
+      <view class="record_box">
+        <view class="score_info">
+          <view class="custom_score">当前积分:{{ scoreInfo.score }}</view>
+          <view class="need_score" v-if="lotteryInfo.id">每次抽奖消耗{{ lotteryInfo.need_score }}积分</view>
+          <view class="need_score" v-if="!lotteryInfo.id">暂无可参与的活动</view>
+        </view>
+        <button class="lottery_record" @click="showRecord" v-if="lotteryInfo.id">
+          <image class="lottery_record_img" src="https://mall.findit.ltd/uploads/images/default/lottery_record.png" mode=""></image>
+          <text class="lottery_record_text">中奖记录</text>
+        </button>
+      </view>
+    </view>
+    <uni-popup ref="lotteryRule" type="center">
+      <view class="lottery_rule_box">
+        <view class="lottery_rule_title">
+          <text>活动规则</text>
+          <view class="close_btn" @click="closeRule"> X </view>
+        </view>
+        <scroll-view class="lottery_rule_info" scroll-y="true">
+          <rich-text :nodes="lotteryInfo.rule" class="rich_text"></rich-text>
+        </scroll-view>
+      </view>
+    </uni-popup>
+    <uni-popup ref="lotteryRecord" type="bottom">
+      <view class="lottery_record_box">
+        <view class="lottery_record_title">
+          <text>我的奖品</text>
+          <view class="close_btn" @click="closeRecord"> X </view>
+        </view>
+        <view class="lottery_record_none" v-if="!recordList.length">这里还是空的哦~</view>
+        <scroll-view class="lottery_record_list" scroll-y="true">
+          <view class="lottery_record_item" v-for="(item, index) in recordList" :key="index">
+            <view class="reward_time">{{ item.insert_time }}</view>
+            <view class="reward_name">{{ item.reward_name }}</view>
+            <view class="reward_state" v-if="item.status">{{ item.state }}</view>
+            <view class="reward_state" v-if="!item.status" @click="openAddr(index)">{{ item.state }}</view>
+          </view>
+        </scroll-view>
+      </view>
+    </uni-popup>
+    <uni-popup ref="addrPopup" type="bottom" class="popup" background-color="#FFFFFF">
+      <view class="popup_title">收货地址 <navigator url="/pages/addr/index?notify=addr" class="to_addr_page">管理</navigator> </view>
+      <view class="addr_list">
+        <view class="addr_item" v-for="(item, index) in addrList" :key="index" @click="checkedAddrItem(item)">
+          <view class="radio_label">
+            <image class="radio_icon" :src="item.id == checkedAddr.id ? '../../static/icon/radioed.png' : '../../static/icon/radio.png'"></image>
+          </view>
+          <view class="contact_user">
+            <text class="contact_name">{{ item.contact_name }}</text>
+            <text class="contact_phone">{{ item.contact_phone }}</text>
+            <text class="contact_default" v-if="item.is_default">默认</text>
+            <text class="contact_shop">{{ item.contact_shop }}</text>
+          </view>
+          <view class="contact_addr"> {{ item.contact_province }} {{ item.contact_city }} {{ item.contact_area }} {{ item.contact_addr }} </view>
+        </view>
+      </view>
+      <view class="create_box">
+        <navigator url="/pages/addr/index?notify=addr&type=create" class="create_addr">新建收货地址</navigator>
+      </view>
+    </uni-popup>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				height:"",
-				// 奖项列表,
-				prizeList: [],
-				// 中奖记录
-				recordList: [],
-				// 地址列表
-				addrList:[],
-				// 抽奖信息
-				lotteryInfo:{
-					id:0,
-					name:"",
-					logo:"",
-					need_score:"",
-					start_date:"",
-					end_date:"",
-					start_time:"",
-					end_time:"",
-					rule:"",
-				},
-				// 积分信息
-				scoreInfo:{
-					score:0,
-					use_score:0,
-					wait_score:0,
-				},
-				// 更新积分信息
-				newScore:{
-					score:0,
-					use_score:0,
-					wait_score:0,
-				},
-				recordId:0,
-			}
-		},
-		onLoad() {
-			// 窗口信息
-			var sysinfo = uni.getWindowInfo();
-			// 获取屏幕可用高度
-			this.height = 'height:'+sysinfo.windowHeight + 'px;';
-			// 监听地址变动
-			uni.$on('addr_list_change',data=>{
-				// 地址列表
-				this.addrList = data.list;
-			});
-			// #ifdef MP-WEIXIN
-			//分享按钮
-			uni.showShareMenu({
-				withShareTicket: true,
-				menus: ['shareAppMessage', 'shareTimeline']
-			})
-			// #endif
-		},
-		onShareAppMessage(obj) {
-			// 获取分享信息
-			let shareList 	= getApp().globalData.shareList;
-			// 获取分享信息
-			let shareObj	= {
-								title: '药优惠 得积分 兑豪礼',
-								path: '/pages/score/lottery',
-								imageUrl:'',
-							};
-			// 循环列表
-			for ( let i in shareList ) {
-				if( shareList[i].pages == 'pages/score/lottery' ) {
-					shareObj.path  = shareList[i].path ? shareList[i].path : shareObj.path ;
-					shareObj.title  = shareList[i].title ? shareList[i].title : shareObj.title ;
-					shareObj.imageUrl  = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl ;
-				}
-			}
-			// 返回分享信息
-			return shareObj;
-		},
-		onShow() {
-			// 没有数据的话,或者请求中,不允许刷新
-			if( this.isReqing )		return ;
-			// 登录提示
-			if( !this.$checkAccess.alterLogin() )  return ;
-			// 设置请求中
-			this.isReqing			= true;
-			// 请求
-			this.$http.request('api/lottery_score/get_detail').then((re)=>{
-				// 设置非请求中
-				this.isReqing		= false;
-				// 成功结果
-				if( re.code == 'success' ){
-					this.lotteryInfo	= re.data;
-					this.prizeList 		= re.data.reward_list;
-				}
-			});
-			// 请求列表
-			this.$http.request('/api/custom_score/get_info',{}).then((re)=>{
-				// 设置非请求中
-				this.isReqing		= false;
-				// 成功结果
-				if( re.code == 'success' ){
-					this.scoreInfo	= re.data;
-					this.newScore   = re.data;
-				}
-			});
-		},
-		methods: {
-			onDone(index) {
-				// 奖项
-				let prize = this.prizeList[index];
-				// 如果是实物
-				this.scoreInfo = this.newScore;
-				uni.showModal({
-					title: prize.id == 0 ? '很遗憾': '恭喜您',
-					content: (prize.id != 0 ? `获得`:'') + prize.name + (prize.reward_type == 5 ? ',请在中奖记录中填写收货地址':''),
-					showCancel:false,
-					success: (re) => {
-						if( re.confirm && prize.reward_type == 5){
-							// 显示中奖列表
-							this.showRecord();
-						}
-					}
-				});
-			},
-			onClick() {
-				// 活动是否开始
-				if( !this.lotteryInfo.id ){
-					uni.showToast({
-						title:"暂无可参与活动",
-						icon:"none",
-					})
-					return;
-				}
-				// 活动是否开始
-				if( this.lotteryInfo.start_time * 1000 > new Date().getTime() ){
-					uni.showToast({
-						title:"活动还没开始哦",
-						icon:"none",
-					})
-					return;
-				}
-				// 活动是否结束
-				if( this.lotteryInfo.end_time * 1000 <= new Date().getTime() ){
-					uni.showToast({
-						title:"活动已结束了哦",
-						icon:"none",
-					})
-					return;
-				}
-				// 积分不足
-				if( this.scoreInfo.score < this.lotteryInfo.need_score ){
-					uni.showToast({
-						title:"积分不足",
-						icon:"none",
-					})
-					return;
-				}
-				// 积分操作
-				this.scoreInfo.score    = this.scoreInfo.score - this.lotteryInfo.need_score;
-				// 请求列表
-				this.$http.request('/api/lottery_score/get_reward',{lottery_id:this.lotteryInfo.id}).then((re)=>{
-					// 设置非请求中
-					this.isReqing		= false;
-					// 成功结果
-					if( re.code == 'success' ){
-						// 奖品列表更新
-						this.prizeList	= re.data.reward_list;
-						this.newScore	= re.data.custom_score;
-						// 奖品的索引
-						return 			this.$refs.dialer.run(re.data.reward_index);
-					}else{
-						uni.showToast({
-							title:re.msg,
-							icon:"none",
-						})
-						// 积分操作
-						this.scoreInfo.score    = this.scoreInfo.score + this.lotteryInfo.need_score;
-						return ;
-					}
-				});
-			},
-			showRule(){
-				this.$refs.lotteryRule.open('center')
-			},
-			closeRule(){
-				this.$refs.lotteryRule.close();
-			},
-			showRecord(){
-				// 活动是否开始
-				if( this.lotteryInfo.id ){
-					// 请求列表
-					this.$http.request('/api/lottery_score_record/get_list',{lottery_id:this.lotteryInfo.id}).then((re)=>{
-						// 设置非请求中
-						this.isReqing		= false;
-						// 成功结果
-						if( re.code == 'success' ){
-							this.recordList	= re.data;
-						}
-					});
-				}
-				this.$refs.lotteryRecord.open('bottom');
-			},
-			closeRecord(){
-				this.$refs.lotteryRecord.close();
-			},
-			openAddr(index){
-				// 选择的下标
-				this.recordIndex = index;
-				// 地址列表
-				this.getAddrList(true);
-			},
-			// 选择地址
-			checkedAddrItem(item){
-				// 判断数据
-				this.$http.request('api/lottery_score_record/set_addr',{id:this.recordList[this.recordIndex].id,addr_id:item.id},'post').then((callback)=>{
-					// 获取成功
-					if( callback.code == 'success' ){
-						this.recordList[this.recordIndex].status = 1;
-						this.recordList[this.recordIndex].state  = '进行中';
-					}
-					this.$refs.addrPopup.close();
-				});
-			},
-			getAddrList(showPopup=false){
-				// 判断数据
-				this.$http.request('api/custom_addr/get_list').then((callback)=>{
-					// 获取成功
-					if( callback.code == 'success' ){
-						this.addrList  = callback.data;
-						// 如果有的话
-						if( this.addrList.length ){
-							// 获取默认的
-							for (let i in this.addrList) {
-								// 如果是默认的
-								if( this.addrList[i].is_default ) this.checkedAddr = this.addrList[i];
-							}
-							// 如果没有默认的话
-							if( !this.checkedAddr.id ){
-								this.checkedAddr = this.addrList[this.addrList.length-1];
-							}
-						}
-						// 弹出地址层
-						if( showPopup ) this.$refs.addrPopup.open('bottom');
-					}
-				});
-			},
-		}
-	}
+export default {
+  data() {
+    return {
+      height: "",
+      // 奖项列表,
+      prizeList: [],
+      // 中奖记录
+      recordList: [],
+      // 地址列表
+      addrList: [],
+      // 抽奖信息
+      lotteryInfo: {
+        id: 0,
+        name: "",
+        logo: "",
+        need_score: "",
+        start_date: "",
+        end_date: "",
+        start_time: "",
+        end_time: "",
+        rule: "",
+      },
+      // 积分信息
+      scoreInfo: {
+        score: 0,
+        use_score: 0,
+        wait_score: 0,
+      },
+      // 更新积分信息
+      newScore: {
+        score: 0,
+        use_score: 0,
+        wait_score: 0,
+      },
+      recordId: 0,
+    };
+  },
+  onLoad() {
+    // 窗口信息
+    var sysinfo = uni.getWindowInfo();
+    // 获取屏幕可用高度
+    this.height = "height:" + sysinfo.windowHeight + "px;";
+    // 监听地址变动
+    uni.$on("addr_list_change", (data) => {
+      // 地址列表
+      this.addrList = data.list;
+    });
+    // #ifdef MP-WEIXIN
+    //分享按钮
+    uni.showShareMenu({
+      withShareTicket: true,
+      menus: ["shareAppMessage", "shareTimeline"],
+    });
+    // #endif
+  },
+  onShareAppMessage(obj) {
+    // 获取分享信息
+    let shareList = getApp().globalData.shareList;
+    // 获取分享信息
+    let shareObj = {
+      title: "学生征订",
+      path: "/pages/score/lottery",
+      imageUrl: "",
+    };
+    // 循环列表
+    for (let i in shareList) {
+      if (shareList[i].pages == "pages/score/lottery") {
+        shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path;
+        shareObj.title = shareList[i].title ? shareList[i].title : shareObj.title;
+        shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl;
+      }
+    }
+    // 返回分享信息
+    return shareObj;
+  },
+  onShow() {
+    // 没有数据的话,或者请求中,不允许刷新
+    if (this.isReqing) return;
+    // 登录提示
+    if (!this.$checkAccess.alterLogin()) return;
+    // 设置请求中
+    this.isReqing = true;
+    // 请求
+    this.$http.request("api/lottery_score/get_detail").then((re) => {
+      // 设置非请求中
+      this.isReqing = false;
+      // 成功结果
+      if (re.code == "success") {
+        this.lotteryInfo = re.data;
+        this.prizeList = re.data.reward_list;
+      }
+    });
+    // 请求列表
+    this.$http.request("/api/custom_score/get_info", {}).then((re) => {
+      // 设置非请求中
+      this.isReqing = false;
+      // 成功结果
+      if (re.code == "success") {
+        this.scoreInfo = re.data;
+        this.newScore = re.data;
+      }
+    });
+  },
+  methods: {
+    onDone(index) {
+      // 奖项
+      let prize = this.prizeList[index];
+      // 如果是实物
+      this.scoreInfo = this.newScore;
+      uni.showModal({
+        title: prize.id == 0 ? "很遗憾" : "恭喜您",
+        content: (prize.id != 0 ? `获得` : "") + prize.name + (prize.reward_type == 5 ? ",请在中奖记录中填写收货地址" : ""),
+        showCancel: false,
+        success: (re) => {
+          if (re.confirm && prize.reward_type == 5) {
+            // 显示中奖列表
+            this.showRecord();
+          }
+        },
+      });
+    },
+    onClick() {
+      // 活动是否开始
+      if (!this.lotteryInfo.id) {
+        uni.showToast({
+          title: "暂无可参与活动",
+          icon: "none",
+        });
+        return;
+      }
+      // 活动是否开始
+      if (this.lotteryInfo.start_time * 1000 > new Date().getTime()) {
+        uni.showToast({
+          title: "活动还没开始哦",
+          icon: "none",
+        });
+        return;
+      }
+      // 活动是否结束
+      if (this.lotteryInfo.end_time * 1000 <= new Date().getTime()) {
+        uni.showToast({
+          title: "活动已结束了哦",
+          icon: "none",
+        });
+        return;
+      }
+      // 积分不足
+      if (this.scoreInfo.score < this.lotteryInfo.need_score) {
+        uni.showToast({
+          title: "积分不足",
+          icon: "none",
+        });
+        return;
+      }
+      // 积分操作
+      this.scoreInfo.score = this.scoreInfo.score - this.lotteryInfo.need_score;
+      // 请求列表
+      this.$http.request("/api/lottery_score/get_reward", { lottery_id: this.lotteryInfo.id }).then((re) => {
+        // 设置非请求中
+        this.isReqing = false;
+        // 成功结果
+        if (re.code == "success") {
+          // 奖品列表更新
+          this.prizeList = re.data.reward_list;
+          this.newScore = re.data.custom_score;
+          // 奖品的索引
+          return this.$refs.dialer.run(re.data.reward_index);
+        } else {
+          uni.showToast({
+            title: re.msg,
+            icon: "none",
+          });
+          // 积分操作
+          this.scoreInfo.score = this.scoreInfo.score + this.lotteryInfo.need_score;
+          return;
+        }
+      });
+    },
+    showRule() {
+      this.$refs.lotteryRule.open("center");
+    },
+    closeRule() {
+      this.$refs.lotteryRule.close();
+    },
+    showRecord() {
+      // 活动是否开始
+      if (this.lotteryInfo.id) {
+        // 请求列表
+        this.$http.request("/api/lottery_score_record/get_list", { lottery_id: this.lotteryInfo.id }).then((re) => {
+          // 设置非请求中
+          this.isReqing = false;
+          // 成功结果
+          if (re.code == "success") {
+            this.recordList = re.data;
+          }
+        });
+      }
+      this.$refs.lotteryRecord.open("bottom");
+    },
+    closeRecord() {
+      this.$refs.lotteryRecord.close();
+    },
+    openAddr(index) {
+      // 选择的下标
+      this.recordIndex = index;
+      // 地址列表
+      this.getAddrList(true);
+    },
+    // 选择地址
+    checkedAddrItem(item) {
+      // 判断数据
+      this.$http.request("api/lottery_score_record/set_addr", { id: this.recordList[this.recordIndex].id, addr_id: item.id }, "post").then((callback) => {
+        // 获取成功
+        if (callback.code == "success") {
+          this.recordList[this.recordIndex].status = 1;
+          this.recordList[this.recordIndex].state = "进行中";
+        }
+        this.$refs.addrPopup.close();
+      });
+    },
+    getAddrList(showPopup = false) {
+      // 判断数据
+      this.$http.request("api/custom_addr/get_list").then((callback) => {
+        // 获取成功
+        if (callback.code == "success") {
+          this.addrList = callback.data;
+          // 如果有的话
+          if (this.addrList.length) {
+            // 获取默认的
+            for (let i in this.addrList) {
+              // 如果是默认的
+              if (this.addrList[i].is_default) this.checkedAddr = this.addrList[i];
+            }
+            // 如果没有默认的话
+            if (!this.checkedAddr.id) {
+              this.checkedAddr = this.addrList[this.addrList.length - 1];
+            }
+          }
+          // 弹出地址层
+          if (showPopup) this.$refs.addrPopup.open("bottom");
+        }
+      });
+    },
+  },
+};
 </script>
 
 <style lang="less">
-	.lottery_box{
-		display: block;
-		width: 750rpx;
-		height: 1100rpx;
-		margin: 0 auto;
-		position: relative;
-		background: linear-gradient(to bottom, #FC335F 0%, #FB7224 80%, #FFFFFF 100%);
-		.lottery_time{
-			top: 0rpx;
-			left: 35rpx;
-			z-index: 1;
-			width: 700rpx;
-			color: #FFFFFF;
-			display: block;
-			height: 40rpx;
-			font-size: 24rpx;
-			line-height: 40rpx;
-			text-align: center;
-			position: absolute;
-			border-radius: 10rpx;
-			background-color: rgba(0, 0, 0,0.15);
-		}
-		.lottery_info{
-			width: 750rpx;
-			overflow: hidden;
-			margin: 0rpx auto;
-			position: relative;
-			margin-bottom: 40rpx;
-			.lottery_logo{
-				float: left;
-				width: 750rpx;
-				display: block;
-			}
-			.lottery_rule_btn{
-				top: 50%;
-				right: 0rpx;
-				width: 120rpx;
-				height: 60rpx;
-				color: #FFFFFF;
-				overflow: hidden;
-				font-size: 24rpx;
-				text-align: center;
-				line-height: 60rpx;
-				position: absolute;
-				padding: 0rpx 0rpx;
-				border-top-left-radius: 30rpx;
-				border-bottom-left-radius: 30rpx;
-				border-top-right-radius: 0rpx;
-				border-bottom-right-radius: 0rpx;
-				background-color: rgba(0, 0, 0,0.3);
-			}
-			.lottery_rule_btn::after{
-				border: 0rpx solid transparent;
-			}
-		}
-		.record_box{
-			display: block;
-			height: 120rpx;
-			overflow: hidden;
-			position: relative;
-			margin-top: 40rpx;
-			.score_info{
-				display: block;
-				overflow: auto;
-				.custom_score{
-					height: 60rpx;
-					font-size: 28rpx;
-					text-align: center;
-					line-height: 60rpx;
-				}
-				.need_score{
-					height: 60rpx;
-					font-size: 32rpx;
-					text-align: center;
-					line-height: 60rpx;
-				}
-			}
-			.lottery_record{
-				top: 0rpx;
-				right: 0rpx;
-				width: 120rpx;
-				height: 120rpx;
-				overflow: hidden;
-				text-align: center;
-				position: absolute;
-				padding: 0rpx 0rpx;
-				background-color: transparent;
-				.lottery_record_img{
-					width: 60rpx;
-					height: 60rpx;
-					display: block;
-					margin: 0rpx auto;
-				}
-				.lottery_record_text{
-					color: #FFFFFF;
-					display: block;
-					height: 40rpx;
-					width: 120rpx;
-					font-size: 24rpx;
-					line-height: 40rpx;
-				}
-			}
-			.lottery_record::after{
-				border: none;
-			}
-		}
-	}
-	.lottery_rule_box{
-		width: 500rpx;
-		display: block;
-		overflow: hidden;
-		background: #FFFFFF;
-		font-size: 26rpx;
-		margin: 0rpx auto;
-		line-height: 50rpx;
-		border-radius: 10rpx;
-		padding: 0rpx 25rpx;
-		padding-bottom: 20rpx;
-		background-color: #FC335F;
-		.lottery_rule_title{
-			color: #FFFFFF;
-			height: 60rpx;
-			font-size: 32rpx;
-			line-height: 60rpx;
-			text-align: center;
-			margin-bottom: 10rpx;
-			.close_btn{
-				float: right;
-				width: 40rpx;
-				height: 40rpx;
-				font-size: 24rpx;
-				margin-top: 9rpx;
-				line-height: 40rpx;
-				border-radius: 50%;
-				border: 1rpx solid #FFFFFF;
-			}
-		}
-		.lottery_rule_info{
-			display: block;
-			height: 500rpx;
-			font-size: 24rpx;
-			line-height: 40rpx;
-			border-radius: 10rpx;
-			padding: 20rpx 20rpx;
-			box-sizing: border-box;
-			background-color: #FFFFFF;
-			.rich_text{
-				white-space: break-spaces;
-			}
-		}
-	}
-	.lottery_record_box{
-		display: block;
-		color: #DEB887;
-		height: 700rpx;
-		padding: 10rpx 25rpx;
-		background-color: #FAEBD7;
-		.lottery_record_title{
-			color: #000000;
-			height: 80rpx;
-			font-weight: bold;
-			font-size: 32rpx;
-			line-height: 80rpx;
-			text-align: center;
-			margin-bottom: 20rpx;
-			.close_btn{
-				float: right;
-				width: 40rpx;
-				height: 40rpx;
-				color: #DEB887;
-				font-size: 24rpx;
-				margin-top: 9rpx;
-				line-height: 40rpx;
-				border-radius: 50%;
-				border: 2rpx solid #DEB887;
-			}
-		}
-		.lottery_record_none{
-			display: block;
-			height: 200rpx;
-			color: #DEB887;
-			font-size: 26rpx;
-			text-align: center;
-			line-height: 200rpx;
-		}
-		.lottery_record_list{
-			display: block;
-			height: 500rpx;
-			.lottery_record_item{
-				height: 80rpx;
-				display: block;
-				font-size: 26rpx;
-				overflow: hidden;
-				line-height: 80rpx;
-				.reward_time{
-					float: left;
-					width: 300rpx;
-				}
-				.reward_name{
-					float: left;
-					width: 200rpx;
-				}
-				.reward_state{
-					float: right;
-				}
-			}
-		}
-	}
-	.popup{
-		overflow: hidden;
-		.popup_title{
-			display: block;
-			overflow: hidden;
-			margin: 0rpx auto;
-			font-size: 36rpx;
-			height: 120rpx;
-			line-height: 120rpx;
-			padding: 0rpx 20rpx;
-			border-bottom: 10rpx solid #F8F8F8;
-			.to_addr_page{
-				float: right;
-				color: #F59A23;
-				display: block;
-				height: 120rpx;
-				line-height: 120rpx;
-				font-size: 26rpx;
-				padding: 0rpx 10rpx;
-			}
-		}
-		.addr_list{
-			width: 730rpx;
-			display: block;
-			overflow: hidden;
-			margin: 0rpx auto;
-			min-height: 500rpx;
-			.addr_item{
-				display: block;
-				font-size: 24rpx;
-				overflow: hidden;
-				line-height: 40rpx;
-				padding: 15rpx 10rpx;
-				border-radius: 15rpx;
-				border-bottom: 2rpx solid #dddddd;
-				.radio_label{
-					width: 40rpx;
-					float: left;
-					height: 50rpx;
-					padding-top: 30rpx;
-					margin-right: 20rpx;
-					.radio_icon{
-						float: left;
-						width: 40rpx;
-						height: 40rpx;
-					}
-				}
-				.contact_user{
-					float: left;
-					width: 640rpx;
-					display: block;
-					height: 50rpx;
-					font-size: 24rpx;
-					line-height: 50rpx;
-					.contact_name{
-						font-size: 26rpx;
-						font-weight: bold;
-						margin-right: 16rpx;
-					}
-					.contact_default{
-						color: #F59A23;
-						font-size: 20rpx;
-						margin-left: 16rpx;
-						border: 1rpx solid #F59A23;
-					}
-					.contact_shop{
-						float: right;
-						font-size: 26rpx;
-						margin-right: 16rpx;
-					}
-				}
-				.contact_addr{
-					float: left;
-					width: 640rpx;
-					display: block;
-					font-size: 24rpx;
-					line-height: 30rpx;
-					padding: 10rpx 5rpx;
-				}
-			}
-		}
-		.create_box{
-			height: 140rpx;
-			display: block;
-			.create_addr{
-				width: 700rpx;
-				height: 80rpx;
-				display: block;
-				color: #FFFFFF;
-				font-size: 30rpx;
-				overflow: hidden;
-				line-height: 80rpx;
-				padding: 0rpx 0rpx;
-				text-align: center;
-				margin: 0rpx auto;
-				margin-top: 20rpx;
-				border-radius: 40rpx;
-				background-color: #E03519;
-			}
-		}
-	}
+.lottery_box {
+  display: block;
+  width: 750rpx;
+  height: 1100rpx;
+  margin: 0 auto;
+  position: relative;
+  background: linear-gradient(to bottom, #fc335f 0%, #fb7224 80%, #ffffff 100%);
+  .lottery_time {
+    top: 0rpx;
+    left: 35rpx;
+    z-index: 1;
+    width: 700rpx;
+    color: #ffffff;
+    display: block;
+    height: 40rpx;
+    font-size: 24rpx;
+    line-height: 40rpx;
+    text-align: center;
+    position: absolute;
+    border-radius: 10rpx;
+    background-color: rgba(0, 0, 0, 0.15);
+  }
+  .lottery_info {
+    width: 750rpx;
+    overflow: hidden;
+    margin: 0rpx auto;
+    position: relative;
+    margin-bottom: 40rpx;
+    .lottery_logo {
+      float: left;
+      width: 750rpx;
+      display: block;
+    }
+    .lottery_rule_btn {
+      top: 50%;
+      right: 0rpx;
+      width: 120rpx;
+      height: 60rpx;
+      color: #ffffff;
+      overflow: hidden;
+      font-size: 24rpx;
+      text-align: center;
+      line-height: 60rpx;
+      position: absolute;
+      padding: 0rpx 0rpx;
+      border-top-left-radius: 30rpx;
+      border-bottom-left-radius: 30rpx;
+      border-top-right-radius: 0rpx;
+      border-bottom-right-radius: 0rpx;
+      background-color: rgba(0, 0, 0, 0.3);
+    }
+    .lottery_rule_btn::after {
+      border: 0rpx solid transparent;
+    }
+  }
+  .record_box {
+    display: block;
+    height: 120rpx;
+    overflow: hidden;
+    position: relative;
+    margin-top: 40rpx;
+    .score_info {
+      display: block;
+      overflow: auto;
+      .custom_score {
+        height: 60rpx;
+        font-size: 28rpx;
+        text-align: center;
+        line-height: 60rpx;
+      }
+      .need_score {
+        height: 60rpx;
+        font-size: 32rpx;
+        text-align: center;
+        line-height: 60rpx;
+      }
+    }
+    .lottery_record {
+      top: 0rpx;
+      right: 0rpx;
+      width: 120rpx;
+      height: 120rpx;
+      overflow: hidden;
+      text-align: center;
+      position: absolute;
+      padding: 0rpx 0rpx;
+      background-color: transparent;
+      .lottery_record_img {
+        width: 60rpx;
+        height: 60rpx;
+        display: block;
+        margin: 0rpx auto;
+      }
+      .lottery_record_text {
+        color: #ffffff;
+        display: block;
+        height: 40rpx;
+        width: 120rpx;
+        font-size: 24rpx;
+        line-height: 40rpx;
+      }
+    }
+    .lottery_record::after {
+      border: none;
+    }
+  }
+}
+.lottery_rule_box {
+  width: 500rpx;
+  display: block;
+  overflow: hidden;
+  background: #ffffff;
+  font-size: 26rpx;
+  margin: 0rpx auto;
+  line-height: 50rpx;
+  border-radius: 10rpx;
+  padding: 0rpx 25rpx;
+  padding-bottom: 20rpx;
+  background-color: #fc335f;
+  .lottery_rule_title {
+    color: #ffffff;
+    height: 60rpx;
+    font-size: 32rpx;
+    line-height: 60rpx;
+    text-align: center;
+    margin-bottom: 10rpx;
+    .close_btn {
+      float: right;
+      width: 40rpx;
+      height: 40rpx;
+      font-size: 24rpx;
+      margin-top: 9rpx;
+      line-height: 40rpx;
+      border-radius: 50%;
+      border: 1rpx solid #ffffff;
+    }
+  }
+  .lottery_rule_info {
+    display: block;
+    height: 500rpx;
+    font-size: 24rpx;
+    line-height: 40rpx;
+    border-radius: 10rpx;
+    padding: 20rpx 20rpx;
+    box-sizing: border-box;
+    background-color: #ffffff;
+    .rich_text {
+      white-space: break-spaces;
+    }
+  }
+}
+.lottery_record_box {
+  display: block;
+  color: #deb887;
+  height: 700rpx;
+  padding: 10rpx 25rpx;
+  background-color: #faebd7;
+  .lottery_record_title {
+    color: #000000;
+    height: 80rpx;
+    font-weight: bold;
+    font-size: 32rpx;
+    line-height: 80rpx;
+    text-align: center;
+    margin-bottom: 20rpx;
+    .close_btn {
+      float: right;
+      width: 40rpx;
+      height: 40rpx;
+      color: #deb887;
+      font-size: 24rpx;
+      margin-top: 9rpx;
+      line-height: 40rpx;
+      border-radius: 50%;
+      border: 2rpx solid #deb887;
+    }
+  }
+  .lottery_record_none {
+    display: block;
+    height: 200rpx;
+    color: #deb887;
+    font-size: 26rpx;
+    text-align: center;
+    line-height: 200rpx;
+  }
+  .lottery_record_list {
+    display: block;
+    height: 500rpx;
+    .lottery_record_item {
+      height: 80rpx;
+      display: block;
+      font-size: 26rpx;
+      overflow: hidden;
+      line-height: 80rpx;
+      .reward_time {
+        float: left;
+        width: 300rpx;
+      }
+      .reward_name {
+        float: left;
+        width: 200rpx;
+      }
+      .reward_state {
+        float: right;
+      }
+    }
+  }
+}
+.popup {
+  overflow: hidden;
+  .popup_title {
+    display: block;
+    overflow: hidden;
+    margin: 0rpx auto;
+    font-size: 36rpx;
+    height: 120rpx;
+    line-height: 120rpx;
+    padding: 0rpx 20rpx;
+    border-bottom: 10rpx solid #f8f8f8;
+    .to_addr_page {
+      float: right;
+      color: #f59a23;
+      display: block;
+      height: 120rpx;
+      line-height: 120rpx;
+      font-size: 26rpx;
+      padding: 0rpx 10rpx;
+    }
+  }
+  .addr_list {
+    width: 730rpx;
+    display: block;
+    overflow: hidden;
+    margin: 0rpx auto;
+    min-height: 500rpx;
+    .addr_item {
+      display: block;
+      font-size: 24rpx;
+      overflow: hidden;
+      line-height: 40rpx;
+      padding: 15rpx 10rpx;
+      border-radius: 15rpx;
+      border-bottom: 2rpx solid #dddddd;
+      .radio_label {
+        width: 40rpx;
+        float: left;
+        height: 50rpx;
+        padding-top: 30rpx;
+        margin-right: 20rpx;
+        .radio_icon {
+          float: left;
+          width: 40rpx;
+          height: 40rpx;
+        }
+      }
+      .contact_user {
+        float: left;
+        width: 640rpx;
+        display: block;
+        height: 50rpx;
+        font-size: 24rpx;
+        line-height: 50rpx;
+        .contact_name {
+          font-size: 26rpx;
+          font-weight: bold;
+          margin-right: 16rpx;
+        }
+        .contact_default {
+          color: #f59a23;
+          font-size: 20rpx;
+          margin-left: 16rpx;
+          border: 1rpx solid #f59a23;
+        }
+        .contact_shop {
+          float: right;
+          font-size: 26rpx;
+          margin-right: 16rpx;
+        }
+      }
+      .contact_addr {
+        float: left;
+        width: 640rpx;
+        display: block;
+        font-size: 24rpx;
+        line-height: 30rpx;
+        padding: 10rpx 5rpx;
+      }
+    }
+  }
+  .create_box {
+    height: 140rpx;
+    display: block;
+    .create_addr {
+      width: 700rpx;
+      height: 80rpx;
+      display: block;
+      color: #ffffff;
+      font-size: 30rpx;
+      overflow: hidden;
+      line-height: 80rpx;
+      padding: 0rpx 0rpx;
+      text-align: center;
+      margin: 0rpx auto;
+      margin-top: 20rpx;
+      border-radius: 40rpx;
+      background-color: #e03519;
+    }
+  }
+}
 </style>

+ 109 - 0
pages/services/index.vue

@@ -0,0 +1,109 @@
+<template>
+  <view class="add_follow" catchtouchmove="true">
+    <view class="info_alter">
+      <text v-show="follow_linkurl">点击二维码添加客服</text>
+      <text v-show="!follow_linkurl">长按二维码添加客服</text>
+    </view>
+    <view class="qr_code_area">
+      <image :src="followQrcode" class="qr_code" mode="" show-menu-by-longpress> </image>
+    </view>
+    <!-- <view class="rule_info">
+      <view class="">报单规则:</view>
+      <view class="">1、预约报单需要添加客服人员</view>
+      <view class="">2、添加完客服人员后填写小程序当前登录手机号以绑定账号</view>
+      <view class="">3、开始预约报单</view>
+    </view> -->
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      follow_linkurl: this.$checkAccess.getFollowLinkUrl(),
+      followQrcode: this.$checkAccess.getFollowQrcode(),
+    };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.add_follow {
+  display: block;
+  color: #ffffff;
+  width: 100vw;
+  height: 100vh;
+  margin: 0 auto;
+  font-size: 26rpx;
+  background: linear-gradient(to bottom, #ff0091 0%, #2c82ff 100%);
+  padding-top: 200rpx;
+  .close_area {
+    height: 80rpx;
+    display: block;
+    line-height: 80rpx;
+
+    .close_btn {
+      color: #ffffff;
+      float: right;
+      width: 80rpx;
+      height: 80rpx;
+      font-size: 26rpx;
+      text-align: center;
+      line-height: 80rpx;
+      padding: 0rpx 0rpx;
+      border: 0rpx solid transparent;
+      background-color: transparent;
+    }
+
+    .close_btn::after {
+      border: 0rpx solid transparent;
+    }
+  }
+
+  .info_alter {
+    display: block;
+    height: 100rpx;
+    font-size: 42rpx;
+    font-weight: bold;
+    text-align: center;
+    line-height: 100rpx;
+  }
+
+  .qr_code_area {
+    display: block;
+    width: 300rpx;
+    height: 300rpx;
+    margin: 30rpx auto;
+
+    .qr_code {
+      float: left;
+      width: 300rpx;
+      height: 300rpx;
+    }
+  }
+
+  .save_btn {
+    color: #333333;
+    display: block;
+    width: 260rpx;
+    height: 80rpx;
+    font-size: 26rpx;
+    text-align: center;
+    line-height: 80rpx;
+    padding: 0rpx 0rpx;
+    margin: 40rpx auto;
+    border-radius: 40rpx;
+    background-color: #ffffff;
+    border: 0rpx solid transparent;
+  }
+
+  .rule_info {
+    width: 600rpx;
+    display: block;
+    font-size: 26rpx;
+    margin: 20rpx auto;
+    overflow: hidden;
+    line-height: 40rpx;
+  }
+}
+</style>

+ 243 - 247
pages/user/index.vue

@@ -1,55 +1,55 @@
 <template>
-	<view>
-		<view class="user_box">
-			<view class="box_left">
-				<navigator url="/pages/user/settings" > 
-					<image class="user_image"  :src="userInfo.userpic" ></image>
-				</navigator>
-			</view>
-			<view class="box_center">
-				<view class="user_name">{{userInfo.username}}</view>
-				<view class="user_info">{{userInfo.phone}}</view>
-			</view>
-			<view class="box_right">
-				<navigator url="/pages/user/info" class="company_text" v-if="!userInfo.city_id">请选择城市</navigator>
-				<navigator url="/pages/user/settings" class="setting_page" v-if="userInfo.city_id" >
-					<image class="setting_icon"  src="../../static/icon/setting.png" ></image>
-				</navigator>
-			</view>
-		</view>
+  <view>
+    <view class="user_box">
+      <view class="box_left">
+        <navigator url="/pages/user/settings">
+          <image class="user_image" :src="userInfo.userpic"></image>
+        </navigator>
+      </view>
+      <view class="box_center">
+        <view class="user_name">{{ userInfo.username }}</view>
+        <view class="user_info">{{ userInfo.phone }}</view>
+      </view>
+      <view class="box_right">
+        <navigator url="/pages/user/info" class="company_text" v-if="!userInfo.city_id">请选择城市</navigator>
+        <navigator url="/pages/user/settings" class="setting_page" v-if="userInfo.city_id">
+          <image class="setting_icon" src="../../static/icon/setting.png"></image>
+        </navigator>
+      </view>
+    </view>
     <view class="navigator_content">
       <view class="navigator_list">
-        <navigator class="navigator_item" url="/pages/orders/index" >
+        <navigator class="navigator_item" url="/pages/orders/index">
           <view class="navigator_image_order">
             <image class="navigator_image" src="../../static/user_icon/user_order_icon.png" mode=""></image>
           </view>
           <view class="navigator_title">我的订单</view>
         </navigator>
-        <navigator class="navigator_item" url="/pages/course/usercourse" >
+        <!-- <navigator class="navigator_item" url="/pages/course/usercourse">
           <view class="navigator_image_class">
             <image class="navigator_image" src="../../static/user_icon/user_class_icon.png" mode=""></image>
           </view>
           <view class="navigator_title">课程表</view>
-        </navigator>
-        <navigator class="navigator_item" url="/pages/score/orders" >
+        </navigator> -->
+        <navigator class="navigator_item" url="/pages/score/orders">
           <view class="navigator_image_score">
             <image class="navigator_image" src="../../static/user_icon/user_score_icon.png" mode=""></image>
           </view>
           <view class="navigator_title">积分订单</view>
         </navigator>
-        <navigator class="navigator_item" url="/pages/addr/index" >
+        <!-- <navigator class="navigator_item" url="/pages/addr/index" >
           <view class="navigator_image_attr">
             <image class="navigator_image" src="../../static/user_icon/user_attr_icon.png" mode=""></image>
           </view>
           <view class="navigator_title">收货地址</view>
-        </navigator>
-        <navigator class="navigator_item" url="/pages/coupon/index" >
+        </navigator> -->
+        <navigator class="navigator_item" url="/pages/coupon/index">
           <view class="navigator_image_coupon">
             <image class="navigator_image" src="../../static/user_icon/user_coupon_icon.png" mode=""></image>
           </view>
           <view class="navigator_title">优惠卷</view>
         </navigator>
-        <navigator class="navigator_item" url="/pages/score/clockin" >
+        <navigator class="navigator_item" url="/pages/score/clockin">
           <view class="navigator_image_order">
             <image class="navigator_image" src="../../static/user_icon/user_clockin_icon.png" mode=""></image>
           </view>
@@ -65,241 +65,237 @@
                 </navigator> -->
       </view>
     </view>
-	</view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				userInfo:{
-					username:"请登录",
-					userpic:"../../static/icon/doctor.png",
-					phone:"kailin",
-					status:0,
-					city_id:0,
-				},
-			}
-		},
-		onLoad() {
-			// #ifdef MP-WEIXIN
-			//分享按钮
-			uni.showShareMenu({
-				withShareTicket: true,
-				menus: ['shareAppMessage', 'shareTimeline']
-			})
-			// #endif
-		},
-		onShareAppMessage(obj) {
-			// 获取分享信息
-			let shareList 	= getApp().globalData.shareList;
-			// 获取分享信息
-			let shareObj	= {
-								title: '药优惠 得积分 兑豪礼',
-								path: '/pages/score/lottery',
-								imageUrl:'',
-							};
-			// 循环列表
-			for ( let i in shareList ) {
-				if( shareList[i].pages == 'pages/user/index' ) {
-					shareObj.path  = shareList[i].path ? shareList[i].path : shareObj.path ;
-					shareObj.title  = shareList[i].title ? shareList[i].title : shareObj.title ;
-					shareObj.imageUrl  = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl ;
-				}
-			}
-			// 返回分享信息
-			return shareObj;
-		},
-		onShow() {
-			// 登录提示
-			if( !this.$checkAccess.alterLogin() ) return ;
-			// 判断数据
-			this.$http.request('api/custom/get_info').then((callback)=>{
-				if( callback.code == 'success' ){
-					if( !callback.data.userpic ) callback.data.userpic = "../../static/icon/doctor.png";
-					// 赋值
-					this.userInfo = callback.data;
-					// 存储登录标识
-					uni.setStorageSync('userInfo',callback.data);
-				}
-			});
-		},
-		methods: {
-			
-		}
-	}
+export default {
+  data() {
+    return {
+      userInfo: {
+        username: "请登录",
+        userpic: "../../static/icon/doctor.png",
+        phone: "kailin",
+        status: 0,
+        city_id: 0,
+      },
+    };
+  },
+  onLoad() {
+    // #ifdef MP-WEIXIN
+    //分享按钮
+    uni.showShareMenu({
+      withShareTicket: true,
+      menus: ["shareAppMessage", "shareTimeline"],
+    });
+    // #endif
+  },
+  onShareAppMessage(obj) {
+    // 获取分享信息
+    let shareList = getApp().globalData.shareList;
+    // 获取分享信息
+    let shareObj = {
+      title: "学生征订",
+      path: "/pages/score/lottery",
+      imageUrl: "",
+    };
+    // 循环列表
+    for (let i in shareList) {
+      if (shareList[i].pages == "pages/user/index") {
+        shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path;
+        shareObj.title = shareList[i].title ? shareList[i].title : shareObj.title;
+        shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl;
+      }
+    }
+    // 返回分享信息
+    return shareObj;
+  },
+  onShow() {
+    // 登录提示
+    if (!this.$checkAccess.alterLogin()) return;
+    // 判断数据
+    this.$http.request("api/custom/get_info").then((callback) => {
+      if (callback.code == "success") {
+        if (!callback.data.userpic) callback.data.userpic = "../../static/icon/doctor.png";
+        // 赋值
+        this.userInfo = callback.data;
+        // 存储登录标识
+        uni.setStorageSync("userInfo", callback.data);
+      }
+    });
+  },
+  methods: {},
+};
 </script>
 
 <style lang="less">
-	.user_box{
-		width: 680rpx;
-		height: 180rpx;
-		overflow: hidden;
-		background: #FFFFFF;
-		padding: 10rpx 35rpx;
-		.box_left{
-			float: left;
-			display: block;
-			width: 140rpx;
-			height: 140rpx;
-			.user_image{
-				display: block;
-				width: 120rpx;
-				height: 120rpx;
-				border-radius: 50%;
-				margin: 10rpx auto;
-			}
-		}
-		.box_center{
-			float: left;
-			width: 300rpx;
-			height: 140rpx;
-			margin-left: 35rpx;
-			.user_name{
-				font-size: 30rpx;
-				line-height: 80rpx;
-			}
-			.user_info{
-				color: #999999;
-				font-size: 24rpx;
-				line-height: 60rpx;
-			}
-		}
-		.box_right{
-			float: right;
-			width: 140rpx;
-			height: 140rpx;
-			font-size: 20rpx;
-			line-height: 140rpx;
-			.setting_page{
-				width: 140rpx;
-				height: 140rpx;
-				display: block;
-				overflow: hidden;
-				.setting_icon{
-					width: 60rpx;
-					height: 60rpx;
-					display: block;
-					margin: 40rpx auto;
-				}
-			}
-			.company_text{
-				color: #E03519;
-				width: 140rpx;
-				height: 140rpx;
-				font-size: 20rpx;
-				text-align: center;
-				line-height: 140rpx;
-			}
-		}
-	}
-  .navigator_content{
-    width: 750rpx;
-    height: 75vh;
-    background-color: #FFFFFF;
-    .navigator_list{
-      width: 690rpx;
-      display: flex;
-      flex-wrap: wrap;
-      padding: 35rpx 0rpx;
-      margin: 0rpx auto;
-      .navigator_item{
-        height: 180rpx;
-        margin: 25rpx;
-        text-align: center;
-        .navigator_image_box{
-          background-color: #ffac1e;
-          border-radius: 40rpx;
-          .navigator_image{
-            width: 80rpx;
-            height: 80rpx;
-            margin: 20rpx auto;
-            border-radius: 5rpx;
-          }
-        }
-        .navigator_image_order{
-          background-color: #ffac1e;
-          border-radius: 40rpx;
-          .navigator_image{
-            width: 80rpx;
-            height: 80rpx;
-            margin: 20rpx auto;
-            border-radius: 5rpx;
-          }
+.user_box {
+  width: 680rpx;
+  height: 180rpx;
+  overflow: hidden;
+  background: #ffffff;
+  padding: 10rpx 35rpx;
+  .box_left {
+    float: left;
+    display: block;
+    width: 140rpx;
+    height: 140rpx;
+    .user_image {
+      display: block;
+      width: 120rpx;
+      height: 120rpx;
+      border-radius: 50%;
+      margin: 10rpx auto;
+    }
+  }
+  .box_center {
+    float: left;
+    width: 300rpx;
+    height: 140rpx;
+    margin-left: 35rpx;
+    .user_name {
+      font-size: 30rpx;
+      line-height: 80rpx;
+    }
+    .user_info {
+      color: #999999;
+      font-size: 24rpx;
+      line-height: 60rpx;
+    }
+  }
+  .box_right {
+    float: right;
+    width: 140rpx;
+    height: 140rpx;
+    font-size: 20rpx;
+    line-height: 140rpx;
+    .setting_page {
+      width: 140rpx;
+      height: 140rpx;
+      display: block;
+      overflow: hidden;
+      .setting_icon {
+        width: 60rpx;
+        height: 60rpx;
+        display: block;
+        margin: 40rpx auto;
+      }
+    }
+    .company_text {
+      color: #e03519;
+      width: 140rpx;
+      height: 140rpx;
+      font-size: 20rpx;
+      text-align: center;
+      line-height: 140rpx;
+    }
+  }
+}
+.navigator_content {
+  width: 750rpx;
+  height: 75vh;
+  background-color: #ffffff;
+  .navigator_list {
+    width: 690rpx;
+    display: flex;
+    flex-wrap: wrap;
+    padding: 35rpx 0rpx;
+    margin: 0rpx auto;
+    .navigator_item {
+      height: 180rpx;
+      margin: 25rpx;
+      text-align: center;
+      .navigator_image_box {
+        background-color: #ffac1e;
+        border-radius: 40rpx;
+        .navigator_image {
+          width: 80rpx;
+          height: 80rpx;
+          margin: 20rpx auto;
+          border-radius: 5rpx;
         }
-        .navigator_image_class{
-          background-color: #29c78a;
-          border-radius: 40rpx;
-          .navigator_image{
-            width: 80rpx;
-            height: 80rpx;
-            margin: 20rpx auto;
-            border-radius: 5rpx;
-          }
+      }
+      .navigator_image_order {
+        background-color: #ffac1e;
+        border-radius: 40rpx;
+        .navigator_image {
+          width: 80rpx;
+          height: 80rpx;
+          margin: 20rpx auto;
+          border-radius: 5rpx;
         }
-        .navigator_image_score{
-          background-color: #3a85ff;
-          border-radius: 40rpx;
-          .navigator_image{
-            width: 80rpx;
-            height: 80rpx;
-            margin: 20rpx auto;
-            border-radius: 5rpx;
-          }
+      }
+      .navigator_image_class {
+        background-color: #29c78a;
+        border-radius: 40rpx;
+        .navigator_image {
+          width: 80rpx;
+          height: 80rpx;
+          margin: 20rpx auto;
+          border-radius: 5rpx;
         }
-        .navigator_image_attr{
-          background-color: #b88fe9;
-          border-radius: 40rpx;
-          .navigator_image{
-            width: 80rpx;
-            height: 80rpx;
-            margin: 20rpx auto;
-            border-radius: 5rpx;
-          }
+      }
+      .navigator_image_score {
+        background-color: #3a85ff;
+        border-radius: 40rpx;
+        .navigator_image {
+          width: 80rpx;
+          height: 80rpx;
+          margin: 20rpx auto;
+          border-radius: 5rpx;
         }
-        .navigator_image_coupon{
-          background-color: #b88fe9;
-          border-radius: 40rpx;
-          .navigator_image{
-            width: 80rpx;
-            height: 80rpx;
-            margin: 20rpx auto;
-            border-radius: 5rpx;
-          }
+      }
+      .navigator_image_attr {
+        background-color: #b88fe9;
+        border-radius: 40rpx;
+        .navigator_image {
+          width: 80rpx;
+          height: 80rpx;
+          margin: 20rpx auto;
+          border-radius: 5rpx;
         }
-        .navigator_image_favo{
-          background-color: #29c78a;
-          border-radius: 40rpx;
-          width: 120rpx;
-          height: 125rpx;
-          display: flex;
-          justify-content: center;
-          align-items: center;
-          .star_icon{
-            // padding: 18rpx 0rpx;
-          }
-
+      }
+      .navigator_image_coupon {
+        background-color: #b88fe9;
+        border-radius: 40rpx;
+        .navigator_image {
+          width: 80rpx;
+          height: 80rpx;
+          margin: 20rpx auto;
+          border-radius: 5rpx;
         }
-        .navigator_title{
-          width: 120rpx;
-          margin-top: 20rpx;
-          display: block;
-          font-size: 30rpx;
-          line-height: 40rpx;
-          text-align: center;
+      }
+      .navigator_image_favo {
+        background-color: #29c78a;
+        border-radius: 40rpx;
+        width: 120rpx;
+        height: 125rpx;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        .star_icon {
+          // padding: 18rpx 0rpx;
         }
       }
+      .navigator_title {
+        width: 120rpx;
+        margin-top: 20rpx;
+        display: block;
+        font-size: 30rpx;
+        line-height: 40rpx;
+        text-align: center;
+      }
     }
-
   }
-	.alter_info{
-		display: block;
-		color: #E03519;
-		font-size: 20rpx;
-		overflow: hidden;
-		margin: 20rpx auto;
-		background: #FFFFFF;
-		line-height: 40rpx;
-		padding: 35rpx 35rpx;
-	}
+}
+.alter_info {
+  display: block;
+  color: #e03519;
+  font-size: 20rpx;
+  overflow: hidden;
+  margin: 20rpx auto;
+  background: #ffffff;
+  line-height: 40rpx;
+  padding: 35rpx 35rpx;
+}
 </style>

+ 137 - 142
pages/user/settings.vue

@@ -1,155 +1,150 @@
 <template>
-	<view>
-		<view class="user_box">
-			<view class="box_left">
-				<image class="user_image"  :src="userInfo.userpic" ></image>
-			</view>
-			<view class="box_center">
-				<view class="user_name">{{userInfo.username}}</view>
-				<view class="user_info">{{userInfo.phone}}</view>
-			</view>
-			<view class="box_right">
-				
-			</view>
-		</view>
-		<view class="setting_list">
-			<navigator class="setting_item" url="/pages/addr/index" >
+  <view>
+    <view class="user_box">
+      <view class="box_left">
+        <image class="user_image" :src="userInfo.userpic"></image>
+      </view>
+      <view class="box_center">
+        <view class="user_name">{{ userInfo.username }}</view>
+        <view class="user_info">{{ userInfo.phone }}</view>
+      </view>
+      <view class="box_right"> </view>
+    </view>
+    <view class="setting_list">
+      <!-- <navigator class="setting_item" url="/pages/addr/index" >
 				<text class="setting_title">收货地址</text>
 				<view class="setting_icon"> &gt; </view>
-			</navigator>
-			<!-- <navigator class="setting_item" url="/pages/settings/settings" >
+			</navigator> -->
+      <!-- <navigator class="setting_item" url="/pages/settings/settings" >
 				<text class="setting_title">权限管理</text>
 				<view class="setting_icon">&gt; </view>
 			</navigator> -->
-		</view>
-		<view class="setting_list">
-			<view class="setting_item" @click="outLogin()" >
-				<text class="setting_title">退出登录</text>
-				<view class="setting_icon">&gt; </view>
-			</view>
-		</view>
-	</view>
+    </view>
+    <view class="setting_list">
+      <view class="setting_item" @click="outLogin()">
+        <text class="setting_title">退出登录</text>
+        <view class="setting_icon">&gt; </view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				userInfo:{
-					username:"",
-					userpic:"",
-					phone:"",
-					status:0,
-					company_status:0,
-				}
-			}
-		},
-		onLoad() {
-			this.$http.request('api/custom/get_info').then((re)=>{
-				if( re.code == 'success' ){
-					this.userInfo = re.data;
-					if( !this.userInfo.userpic ) this.userInfo.userpic = "../../static/icon/doctor.png";
-				}
-			});
-		},
-		onShow() {
-			
-		},
-		methods: {
-			outLogin(){
-				uni.showModal({
-					title:"确认退出登录?",
-					success(re) {
-						if (re.confirm) {
-							// 清空登录标识
-							uni.setStorageSync('userLogin',null);
-							// 清空用户信息
-							uni.setStorageSync('userInfo',null);
-							// 跳转到登录页
-							uni.redirectTo({
-								url:"/pages/login/index"
-							})
-						}
-					}
-				})
-			}
-		}
-	}
+export default {
+  data() {
+    return {
+      userInfo: {
+        username: "",
+        userpic: "",
+        phone: "",
+        status: 0,
+        company_status: 0,
+      },
+    };
+  },
+  onLoad() {
+    this.$http.request("api/custom/get_info").then((re) => {
+      if (re.code == "success") {
+        this.userInfo = re.data;
+        if (!this.userInfo.userpic) this.userInfo.userpic = "../../static/icon/doctor.png";
+      }
+    });
+  },
+  onShow() {},
+  methods: {
+    outLogin() {
+      uni.showModal({
+        title: "确认退出登录?",
+        success(re) {
+          if (re.confirm) {
+            // 清空登录标识
+            uni.setStorageSync("userLogin", null);
+            // 清空用户信息
+            uni.setStorageSync("userInfo", null);
+            // 跳转到登录页
+            uni.redirectTo({
+              url: "/pages/login/index",
+            });
+          }
+        },
+      });
+    },
+  },
+};
 </script>
 
 <style lang="less">
-	.user_box{
-		width: 680rpx;
-		height: 180rpx;
-		overflow: hidden;
-		background: #FFFFFF;
-		padding: 10rpx 35rpx;
-		.box_left{
-			float: left;
-			display: block;
-			width: 140rpx;
-			height: 140rpx;
-			.user_image{
-				display: block;
-				width: 120rpx;
-				height: 120rpx;
-				border-radius: 50%;
-				margin: 10rpx auto;
-			}
-		}
-		.box_center{
-			float: left;
-			width: 300rpx;
-			height: 140rpx;
-			margin-left: 35rpx;
-			.user_name{
-				font-size: 30rpx;
-				line-height: 80rpx;
-			}
-			.user_info{
-				color: #999999;
-				font-size: 24rpx;
-				line-height: 60rpx;
-			}
-		}
-		.box_right{
-			float: right;
-			width: 140rpx;
-			height: 140rpx;
-			font-size: 20rpx;
-			.setting_page{
-				width: 140rpx;
-				height: 140rpx;
-				display: block;
-				overflow: hidden;
-				.setting_icon{
-					width: 60rpx;
-					height: 60rpx;
-					display: block;
-					margin: 40rpx auto;
-				}
-			}
-		}
-	}
-	.setting_list{
-		overflow: hidden;
-		margin: 10rpx auto;
-		padding: 0rpx 0rpx;
-		.setting_item{
-			height: 80rpx;
-			display: block;
-			font-size: 26rpx;
-			line-height: 80rpx;
-			margin: 10rpx auto;
-			padding: 0rpx 35rpx;
-			background: #FFFFFF;
-			.setting_title{
-			}
-			.setting_icon{
-				float: right;
-				color: #999999;
-			}
-		}
-	}
-	
+.user_box {
+  width: 680rpx;
+  height: 180rpx;
+  overflow: hidden;
+  background: #ffffff;
+  padding: 10rpx 35rpx;
+  .box_left {
+    float: left;
+    display: block;
+    width: 140rpx;
+    height: 140rpx;
+    .user_image {
+      display: block;
+      width: 120rpx;
+      height: 120rpx;
+      border-radius: 50%;
+      margin: 10rpx auto;
+    }
+  }
+  .box_center {
+    float: left;
+    width: 300rpx;
+    height: 140rpx;
+    margin-left: 35rpx;
+    .user_name {
+      font-size: 30rpx;
+      line-height: 80rpx;
+    }
+    .user_info {
+      color: #999999;
+      font-size: 24rpx;
+      line-height: 60rpx;
+    }
+  }
+  .box_right {
+    float: right;
+    width: 140rpx;
+    height: 140rpx;
+    font-size: 20rpx;
+    .setting_page {
+      width: 140rpx;
+      height: 140rpx;
+      display: block;
+      overflow: hidden;
+      .setting_icon {
+        width: 60rpx;
+        height: 60rpx;
+        display: block;
+        margin: 40rpx auto;
+      }
+    }
+  }
+}
+.setting_list {
+  overflow: hidden;
+  margin: 10rpx auto;
+  padding: 0rpx 0rpx;
+  .setting_item {
+    height: 80rpx;
+    display: block;
+    font-size: 26rpx;
+    line-height: 80rpx;
+    margin: 10rpx auto;
+    padding: 0rpx 35rpx;
+    background: #ffffff;
+    .setting_title {
+    }
+    .setting_icon {
+      float: right;
+      color: #999999;
+    }
+  }
+}
 </style>

BIN
static/icon/doctor.png


BIN
static/logo2.jpg


+ 114 - 107
utils/checkaccess.js

@@ -1,120 +1,127 @@
-
 // 检查登录
-const checkLogin = ()=>{
-	// 获取登录标识
-	let userLogin = uni.getStorageSync('userLogin');
-	// 如果不存在的话
-	if( !userLogin || !userLogin.authcode || userLogin.expires_in <= Math.floor(new Date().getTime() / 1000) ) {
-		// 未登录
-		return false;
-	}
-	// 登录成功
-	return true;
-}
+const checkLogin = () => {
+  // 获取登录标识
+  let userLogin = uni.getStorageSync("userLogin");
+  // 如果不存在的话
+  if (!userLogin || !userLogin.authcode || userLogin.expires_in <= Math.floor(new Date().getTime() / 1000)) {
+    // 未登录
+    return false;
+  }
+  // 登录成功
+  return true;
+};
 
 // 登录提示
-const alterLogin = ()=>{
-	// 获取登录标识
-	let userLogin = uni.getStorageSync('userLogin');
-	// 如果不存在的话
-	if( !userLogin || !userLogin.authcode || userLogin.expires_in <= Math.floor(new Date().getTime() / 1000) ) {
-		// 未登录
-		uni.showModal({
-			title:"请登录",
-			success(res){
-				if (res.confirm) {
-					// 用户点击确定按钮
-					uni.navigateTo({
-						url:"/pages/login/index"
-					})
-				}
-			}
-		})
-		return false;
-	}
-	// 登录成功
-	return true;
-}
-
-
-
+const alterLogin = () => {
+  // 获取登录标识
+  let userLogin = uni.getStorageSync("userLogin");
+  // 如果不存在的话
+  if (!userLogin || !userLogin.authcode || userLogin.expires_in <= Math.floor(new Date().getTime() / 1000)) {
+    // 未登录
+    uni.showModal({
+      title: "请登录",
+      success(res) {
+        if (res.confirm) {
+          // 用户点击确定按钮
+          uni.navigateTo({
+            url: "/pages/login/index",
+          });
+        }
+      },
+    });
+    return false;
+  }
+  // 登录成功
+  return true;
+};
 
 // 检查企业资质
-const checkShowPrice	= ()=>{
-	// 获取登录标识
-	let userInfo   			= uni.getStorageSync('userInfo');
-	// 如果未登录,不显示
-	if( !userInfo )			return false;
-	// 未加好友不显示
-	if( !userInfo.show_price ) return false;
-	// 登录成功
-	return 					true;
-}
+const checkShowPrice = () => {
+  // 获取登录标识
+  let userInfo = uni.getStorageSync("userInfo");
+  // 如果未登录,不显示
+  if (!userInfo) return false;
+  // 未加好友不显示
+  if (!userInfo.show_price) return false;
+  // 登录成功
+  return true;
+};
 
 // 检查城市ID
-const getCity	= ()=>{
-	// 获取登录标识
-	let userInfo   	= uni.getStorageSync('userInfo');
-	// 如果不存在的话
-	if( !userInfo )	return '';
-	// 资质ID不存在的话
-	if( !userInfo.city_id ) return '';
-	// 登录成功
-	return userInfo.city_id;
-}
+const getCity = () => {
+  // 获取登录标识
+  let userInfo = uni.getStorageSync("userInfo");
+  // 如果不存在的话
+  if (!userInfo) return "";
+  // 资质ID不存在的话
+  if (!userInfo.city_id) return "";
+  // 登录成功
+  return userInfo.city_id;
+};
 
 // 是否要求填写城市
-const alertCity	= ()=>{
-	// 获取登录标识
-	let userInfo   		= uni.getStorageSync('userInfo');
-	// 如果不存在的话
-	if( !userInfo || !userInfo.city_id){
-		// 未登录
-		uni.showModal({
-			title:"请先选择您的城市",
-			success(res){
-				if (res.confirm) {
-					// 用户点击确定按钮
-					uni.navigateTo({
-						url:"/pages/user/info"
-					})
-				}
-			}
-		});
-		return false;
-	}		
-	// 登录成功
-	return true;
-}
-
-
-
-
+const alertCity = () => {
+  // 获取登录标识
+  let userInfo = uni.getStorageSync("userInfo");
+  // 如果不存在的话
+  if (!userInfo || !userInfo.city_id) {
+    // 未登录
+    uni.showModal({
+      title: "请先选择您的城市",
+      success(res) {
+        if (res.confirm) {
+          // 用户点击确定按钮
+          uni.navigateTo({
+            url: "/pages/user/info",
+          });
+        }
+      },
+    });
+    return false;
+  }
+  // 登录成功
+  return true;
+};
 
 // 检查客服推送码
-const getFollowQrcode	= ()=>{
-	// 获取登录标识
-	let userInfo   					= uni.getStorageSync('userInfo');
-	// 如果不存在的话
-	if( !userInfo )					return '';
-	// 未添加好友
-	if( !userInfo.follow_qrcode )	return '';
-	// 返回结果
-	return 							userInfo.follow_qrcode;
-}
-
+const getFollowQrcode = () => {
+  // 获取登录标识
+  let userInfo = uni.getStorageSync("userInfo");
+  // 如果不存在的话
+  if (!userInfo) return "";
+  // 未添加好友
+  if (!userInfo.follow_qrcode) return "";
+  // 返回结果
+  return userInfo.follow_qrcode;
+};
 
 // 检查客服推送码
-const getFollowLinkUrl	= ()=>{
-	// 获取登录标识
-	let userInfo   					= uni.getStorageSync('userInfo');
-	// 如果不存在的话
-	if( !userInfo )					return '';
-	// 未添加好友
-	if( !userInfo.follow_linkurl )	return '';
-	// 返回结果
-	return 							userInfo.follow_linkurl;
-}
-
-
-export default {checkLogin:checkLogin,alterLogin:alterLogin,checkShowPrice:checkShowPrice,alertCity:alertCity,getFollowQrcode:getFollowQrcode,getFollowLinkUrl:getFollowLinkUrl,getCity:getCity}
+const getFollowLinkUrl = () => {
+  // 获取登录标识
+  let userInfo = uni.getStorageSync("userInfo");
+  // 如果不存在的话
+  if (!userInfo) return "";
+  // 未添加好友
+  if (!userInfo.follow_linkurl) return "";
+  // 返回结果
+  return userInfo.follow_linkurl;
+};
+
+const getHasFollow = () => {
+  // 获取登录标识
+  let userInfo = uni.getStorageSync("userInfo");
+  // 如果不存在的话
+  if (!userInfo) return false;
+  return userInfo.have_follow == 1;
+};
+
+export default {
+  checkLogin: checkLogin,
+  alterLogin: alterLogin,
+  checkShowPrice: checkShowPrice,
+  alertCity: alertCity,
+  getFollowQrcode: getFollowQrcode,
+  getFollowLinkUrl: getFollowLinkUrl,
+  getCity: getCity,
+  getHasFollow: getHasFollow,
+};