소스 검색

fix:更新

钱新宇 2 달 전
부모
커밋
11293e359c
9개의 변경된 파일857개의 추가작업 그리고 31개의 파일을 삭제
  1. 0 0
      lib/alivc-im.js
  2. 28 31
      main.js
  3. 12 0
      pages.json
  4. 16 0
      pages/live/index.vue
  5. 3 0
      pages/login/index.vue
  6. 724 0
      pages/recruitment/lottery.vue
  7. 4 0
      pages/user/index.vue
  8. BIN
      static/mp-weixin/alivc-im.wasm.br
  9. 70 0
      utils/live.js

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
lib/alivc-im.js


+ 28 - 31
main.js

@@ -1,39 +1,36 @@
 // 引入模块
-import App from './App'
-import {
-	createSSRApp
-} from 'vue'
+import App from "./App";
+import { createSSRApp } from "vue";
 // 全局请求
-import http from './utils/request.js'
+import http from "./utils/request.js";
 // 精度计算
-import decimal from './utils/decimal.js'
+import decimal from "./utils/decimal.js";
 // 精度计算
-import checkAccess from './utils/checkaccess.js'
+import checkAccess from "./utils/checkaccess.js";
 
 export function createApp() {
-	// 创建APP
-	const app = createSSRApp(App)
+  // 创建APP
+  const app = createSSRApp(App);
 
+  const CONSTANTS = {
+    SHOP_TYPES: {
+      1: "单店",
+      2: "连锁",
+      3: "诊所、社康等",
+    },
+  };
 
-	const CONSTANTS = {
-		SHOP_TYPES: {
-			1: '单店',
-			2: '连锁',
-			3: '诊所、社康等'
-		}
-	};
-
-	// 挂载全局属性 
-	app.config.globalProperties.$http = http
-	// 挂载全局属性
-	app.config.globalProperties.$decimal = decimal
-	// 挂载全局属性
-	app.config.globalProperties.$checkAccess = checkAccess
-	// 全局注册组件
-	// app.component()
-	//挂载全局常量
-	app.config.globalProperties.$CONSTANTS = CONSTANTS
-	return {
-		app
-	}
-}
+  // 挂载全局属性
+  app.config.globalProperties.$http = http;
+  // 挂载全局属性
+  app.config.globalProperties.$decimal = decimal;
+  // 挂载全局属性
+  app.config.globalProperties.$checkAccess = checkAccess;
+  // 全局注册组件
+  // app.component()
+  //挂载全局常量
+  app.config.globalProperties.$CONSTANTS = CONSTANTS;
+  return {
+    app,
+  };
+}

+ 12 - 0
pages.json

@@ -150,6 +150,12 @@
         "navigationBarTitleText": "下单抽奖"
       }
     },
+    {
+      "path": "pages/recruitment/lottery",
+      "style": {
+        "navigationBarTitleText": "新人抽奖"
+      }
+    },
     {
       "path": "pages/recruitment/index",
       "style": {
@@ -255,6 +261,12 @@
       "style": {
         "navigationBarTitleText": "课后测评"
       }
+    },
+    {
+      "path": "pages/live/index",
+      "style": {
+        "navigationBarTitleText": "直播"
+      }
     }
   ],
   "globalStyle": {

+ 16 - 0
pages/live/index.vue

@@ -0,0 +1,16 @@
+<template></template>
+
+<script>
+import { initEngine } from "../../utils/live";
+export default {
+  data() {
+    return {};
+  },
+  onLoad(params) {
+    console.log("互动消息初始化");
+    initEngine();
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 3 - 0
pages/login/index.vue

@@ -41,6 +41,7 @@ export default {
     if (options.redirect) {
       this.redirect = options.redirect;
       this.activity_id = options.activity_id;
+      this.id = options.id;
     }
   },
   methods: {
@@ -69,6 +70,7 @@ export default {
             if (this.redirect) {
               let url = this.redirect;
               if (this.activity_id) url = url + "?id=" + this.activity_id;
+              if (this.id) url = url + "?id=" + this.id;
               uni.redirectTo({ url: url });
             } else uni.switchTab({ url: "/pages/user/index" });
           } else {
@@ -117,6 +119,7 @@ export default {
           if (this.redirect) {
             let url = this.redirect;
             if (this.activity_id) url = url + "?id=" + this.activity_id;
+            if (this.id) url = url + "?id=" + this.id;
             uni.redirectTo({ url: url });
           } else uni.switchTab({ url: "/pages/user/index" });
         } else {

+ 724 - 0
pages/recruitment/lottery.vue

@@ -0,0 +1,724 @@
+<template>
+  <view>
+    <view class="lottery_box">
+      <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">可用次数:{{ lotteryInfo.number }}</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>
+      <!-- <button open-type="share" class="share-btn">分享好友再答一次题</button> -->
+    </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 ? 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/radioed.png' : 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/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>
+    <uni-popup ref="addFollow" type="center" class="center_popup">
+      <FollowPopup
+        :picUrl="'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/qrcode/qrcode.jpg'"
+        :closePopup="closePopup"
+        :showRule="false"
+        :clickTitle="'点击二维码添加客服抽奖'"
+        :longTapTitle="'长按二维码添加客服抽奖'"
+      />
+    </uni-popup>
+  </view>
+</template>
+
+<script>
+import FollowPopup from "@/components/FollowPopup/FollowPopup.vue";
+export default {
+  components: {
+    FollowPopup,
+  },
+  data() {
+    return {
+      height: "",
+      // 奖项列表,
+      prizeList: [],
+      // 中奖记录
+      recordList: [],
+      // 地址列表
+      addrList: [],
+      // 抽奖信息
+      lotteryInfo: {
+        id: 0,
+        name: "",
+        logo: "",
+        number: "0",
+        start_date: "",
+        end_date: "",
+        start_time: "",
+        end_time: "",
+        rule: "",
+      },
+      recordId: 0,
+      // 请求参数
+      requestParam: {
+        id: 0,
+        activity_id: 0,
+      },
+    };
+  },
+  onLoad(param) {
+    //未登陆提醒用户登陆
+    try {
+      // 接收参数
+      console.log(param, "onload  param");
+
+      this.requestParam.id = param.id;
+      this.requestParam.activity_id = param.activity_id;
+      // 如果有scene参数的话,获取其中的ID
+      if (param.scene) {
+        // 转键值对参数
+        let scene = this.$http.strToParam(param.scene);
+        // 如果没有传入ID,但是传入了场景ID,获取场景ID
+        if (!param.id && scene.id) this.requestParam.id = scene.id;
+      }
+      // 窗口信息
+      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
+    } catch (e) {
+      console.log(e);
+    }
+  },
+  onShareAppMessage(obj) {
+    // if (obj) {
+    //   this.shareRequest();
+    // }
+    return {
+      title: "999智控终端平台\n新人抽奖",
+      path: `/pages/recruitment/lottery?id=${this.requestParam.id}&activity_id=${this.requestParam.activity_id}`,
+      imageUrl: "https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/20250210-143021.jpg",
+      promise: new Promise((resolve, reject) => {
+        this.$http.request("api/share_message/get_item", { item_id: this.requestParam.activity_id, pages: "/pages/recruitment/lottery" }).then((callback) => {
+          console.log(callback, "api/share_message/get_item");
+          let obj = {
+            title: callback.data?.title == "" ? this.lotteryInfo.name : callback.data.title,
+            path: "/pages/activity/index?id=" + this.requestParam.activity_id,
+            imageUrl: callback.data?.image_url == "" ? this.lotteryInfo.logo : callback.data.image_url,
+          };
+          resolve(obj);
+        });
+      }),
+    };
+  },
+  onShow() {
+    console.log(this.requestParam, "onshow  requestParam");
+
+    if (!this.$checkAccess.checkLogin()) {
+      uni.showModal({
+        title: "温馨提示",
+        content: "请先登录",
+        confirmText: "去登录",
+        cancelText: "取消",
+        success: (res) => {
+          if (res.confirm) {
+            uni.redirectTo({
+              url: `/pages/login/index?redirect=/pages/recruitment/lottery&id=${this.requestParam.id}`,
+            });
+          }
+        },
+      });
+      return;
+    }
+    // 没有数据的话,或者请求中,不允许刷新
+    if (this.isReqing) return;
+    // 登录提示
+    // if (!this.$checkAccess.alterLogin()) return;
+    // 如果存在产品ID的话
+    if (this.requestParam.id > 0) {
+      // 设置请求中
+      this.isReqing = true;
+      // 请求
+      this.$http.request("api/lottery_recruitment/get_detail", this.requestParam).then((re) => {
+        // 设置非请求中
+        this.isReqing = false;
+        // 成功结果
+        if (re.code == "success") {
+          this.lotteryInfo = re.data;
+          this.prizeList = re.data.reward_list;
+        } else {
+          if (re.code != "no_login") {
+            uni.showModal({
+              content: re.msg,
+              showCancel: false,
+            });
+          }
+        }
+      });
+    } else {
+      uni.showModal({
+        content: "未知的活动ID",
+        showCancel: false,
+      });
+    }
+  },
+  methods: {
+    // shareRequest() {
+    //   this.$http.request("api/riddle_active_share/add", { active_id: this.requestParam.activity_id }).then((response) => {
+    //     uni.showModal({
+    //       title: "分享成功",
+    //       confirmText: "立即答题",
+    //       cancelText: "留在此页",
+    //       success: (res) => {
+    //         if (res.confirm) {
+    //           uni.redirectTo({
+    //             url: "/pages/activity/index?id=" + this.requestParam.activity_id,
+    //           });
+    //         }
+    //       },
+    //     });
+    //   });
+    // },
+
+    onDone(index) {
+      // 奖项
+      let prize = this.prizeList[index];
+      // 结果
+      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.lotteryInfo.number <= 0) {
+        uni.showToast({
+          title: "次数已用完了",
+          icon: "none",
+        });
+        return;
+      }
+      if (!this.$checkAccess.getHasFollow()) {
+        this.$refs.addFollow.open("center");
+        return;
+      }
+      // 次数操作
+      this.lotteryInfo.number = this.lotteryInfo.number - 1;
+      // 请求列表
+      this.$http.request("/api/lottery_recruitment/get_reward", { lottery_id: this.lotteryInfo.id }).then((re) => {
+        // 设置非请求中
+        this.isReqing = false;
+        // 成功结果
+        if (re.code == "success") {
+          // 奖品列表更新
+          this.prizeList = re.data.reward_list;
+          // 奖品的索引
+          return this.$refs.dialer.run(re.data.reward_index);
+        } else {
+          uni.showToast({
+            title: re.msg,
+            icon: "none",
+          });
+          return;
+        }
+      });
+    },
+    closePopup() {
+      this.$refs.addFollow.close();
+    },
+    showRule() {
+      this.$refs.lotteryRule.open("center");
+    },
+    closeRule() {
+      this.$refs.lotteryRule.close();
+    },
+    showRecord() {
+      // 活动是否开始
+      if (this.lotteryInfo.id) {
+        // 请求列表
+        this.$http.request("/api/lottery_riddle_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_riddle_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;
+  margin: 0 auto;
+  position: relative;
+  background: linear-gradient(to bottom, #fc335f 0%, #fb7224 80%, #ffffff 100%);
+  padding-bottom: 200rpx;
+  .share-btn {
+    width: 80%;
+    height: 80rpx;
+    background-color: #f0370e;
+    color: #fff;
+    border-radius: 60rpx;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    padding: 16rpx;
+    margin-top: 60rpx;
+    box-sizing: border-box;
+  }
+  .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;
+      height: 240rpx;
+      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>

+ 4 - 0
pages/user/index.vue

@@ -61,6 +61,10 @@
         <image class="navigator_image" src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/video.png" mode=""></image>
         <view class="navigator_title">学习</view>
       </navigator>
+      <!-- <navigator class="navigator_item" url="/pages/live/index">
+        <image class="navigator_image" src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/video.png" mode=""></image>
+        <view class="navigator_title">直播</view>
+      </navigator> -->
     </view>
     <view class="alter_info">本程序暂不提供在线交易以及支付功能,您所提交的预约,我们将验证您的购药资质并交由有售卖药品资质的商业公司与您联系确认并提供线下后续服务。</view>
     <view class="packet_content" v-if="show_packet">

BIN
static/mp-weixin/alivc-im.wasm.br


+ 70 - 0
utils/live.js

@@ -0,0 +1,70 @@
+// 请结合您项目实际情况引入 SDK
+import { ImEngine, ImLogLevel } from "../lib/alivc-im.js";
+
+const initEngine = async () => {
+  const engine = ImEngine.createEngine();
+
+  try {
+    await engine.init({
+      appId: "APP_ID", // 开通应用后可以在控制台上拷贝
+      appSign: "APP_SIGN", // 开通应用后可以在控制台上拷贝
+      logLevel: ImLogLevel.ERROR, // 日志级别,调试时使用 ImLogLevel.DBUG
+      // 指定引入的 wasm 的地址
+      locateFile: (url) => {
+        if (url.endsWith(".wasm")) {
+          // 需要根据您项目 alivc-im.wasm.br 文件存放位置修改返回的路径
+          // 这里是从项目根目录读取文件,而不是当前文件的目录下,因此不需要使用 .. 和 . 这些相对路径
+          // 如果您参考了上面 uni-app 工程的目录结构,那么这里返回 /static/mp-weixin/alivc-im.wasm.br
+          // 如果您参考了上面 Taro 工程的目录结构,那么这里返回 /static/alivc-im.wasm.br
+          return "/static/mp-weixin/alivc-im.wasm.br";
+        }
+        return url;
+      },
+    });
+    // 需确认init异步操作成功后,才可以继续执行login等操作
+
+    // 初始化成功,监听事件
+    engine.on("connecting", () => {
+      console.log("connecting");
+    });
+
+    engine.on("connectfailed", (err) => {
+      console.log(`connect failed: ${err.message}`);
+    });
+
+    engine.on("connectsuccess", () => {
+      console.log("connect success");
+    });
+
+    engine.on("disconnect", (code) => {
+      // code 断开原因 1:主动退出, 2:被踢出 3:超时等其他原因 4:在其他端上登录
+      console.log(`disconnect: ${code}`);
+    });
+
+    engine.on("linkstate", (data) => {
+      // 链接状态发生变化,state 状态 0:未连接 1:连接中 2:已连接 3:已断联
+      console.log(`previousState: ${data.previousState}, currentState: ${data.currentState}`);
+    });
+
+    engine.on("reconnectsuccess", (groupInfos) => {
+      // 重连成功,会返回所在群组的数据
+      console.log(groupInfos);
+    });
+
+    engine.on("tokenexpired", async (cb) => {
+      // 这里需要更新为获取新的登录信息的代码
+      const auth = await getLoginAuth();
+      cb(null, {
+        timestamp: 22123123, // 服务端返回timestamp值
+        nonce: "nonce", // 服务端返回nonce值
+        token: "xxx", // 服务端返回token值
+      });
+    });
+  } catch (error) {
+    // init 错误码含义
+    // 1001:重复初始化、1002:创建底层引擎失败、-1:底层重复初始化、-2:初始化配置信息有误
+    console.log(`Init Fail: code:${error.code}, message: ${error.msg}`);
+  }
+};
+
+export { initEngine };

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.