|
@@ -0,0 +1,358 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="en">
|
|
|
+
|
|
|
+<head>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
+ <title>数据查看</title>
|
|
|
+ <!--引入 element-ui 的样式,-->
|
|
|
+ <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
|
|
+ <!-- 必须先引入vue, 后使用element-ui -->
|
|
|
+ <script src="./js/vue.js"></script>
|
|
|
+ <!-- 引入element 的组件库-->
|
|
|
+ <script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
|
|
+ <script src="https://unpkg.com/vconsole/dist/vconsole.min.js"></script>
|
|
|
+ <!-- <script>
|
|
|
+ var vConsole = new window.VConsole();
|
|
|
+ </script> -->
|
|
|
+</head>
|
|
|
+<style>
|
|
|
+ body {
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+ .box {
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background: #FAFAFA;
|
|
|
+ }
|
|
|
+ .page4 {
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 20px 10px 0;
|
|
|
+ }
|
|
|
+ .data_box {
|
|
|
+ height: 137px;
|
|
|
+ margin: 0 auto;
|
|
|
+ background: #FFFFFF;
|
|
|
+ border-radius: 10px;
|
|
|
+ padding: 20px 48px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+ .data_title {
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #222222;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .total_num {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ text-align: center;
|
|
|
+ padding-top: 20px;
|
|
|
+ }
|
|
|
+ .data_line {
|
|
|
+ width: 1px;
|
|
|
+ height: 49px;
|
|
|
+ background: #F5F5F5;
|
|
|
+ }
|
|
|
+ .total {
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 24px;
|
|
|
+ color: #222222;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+ .des {
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #222222;
|
|
|
+ padding-top: 5px;
|
|
|
+ }
|
|
|
+ .prize_list {
|
|
|
+ background: #FFFFFF;
|
|
|
+ height: calc(100vh - 167px);
|
|
|
+ margin-top: 10px;
|
|
|
+ padding: 20px 15px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+ .prize_title {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ padding-bottom: 5px;
|
|
|
+ }
|
|
|
+ .prize_title img{
|
|
|
+ width: 22px;
|
|
|
+ height: 22px;
|
|
|
+ }
|
|
|
+ .prize_title span{
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #222222;
|
|
|
+ padding: 0 5px;
|
|
|
+ }
|
|
|
+ .prize_item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ border-bottom: 1px solid #F9F9F9;
|
|
|
+ padding: 15px 0 20px;
|
|
|
+ }
|
|
|
+ .prize_item_title {
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #222222;
|
|
|
+ line-height: 20px;
|
|
|
+ }
|
|
|
+ .prize_item_num {
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #666666;
|
|
|
+ padding-top: 5px;
|
|
|
+ line-height: 17px;
|
|
|
+ }
|
|
|
+ .prize_item_btn {
|
|
|
+ width: 72px;
|
|
|
+ height: 33px;
|
|
|
+ line-height: 33px;
|
|
|
+ border-radius: 17px;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #FFFFFF;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .btn_no {
|
|
|
+ background: #2885FF;
|
|
|
+ }
|
|
|
+ .btn_ok {
|
|
|
+ background: #CCCCCC;
|
|
|
+ }
|
|
|
+ .el-dialog {
|
|
|
+ width: 335px;
|
|
|
+ border-radius: 20px;
|
|
|
+ }
|
|
|
+ .el-dialog__header {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .el-dialog__title {
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #222222;
|
|
|
+ }
|
|
|
+ .prize_form .el-form-item{
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+ .prize_form .el-form-item__label {
|
|
|
+ line-height: 20px;
|
|
|
+ }
|
|
|
+ .prize_form .el-input {
|
|
|
+ border: 1px solid #CCCCCC;
|
|
|
+ border-radius: 5px;
|
|
|
+ width: 295px;
|
|
|
+ }
|
|
|
+ .prize_form .el-input__inner {
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ .dialog-footer {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .dialog-footer button {
|
|
|
+ width: 119px;
|
|
|
+ height: 46px;
|
|
|
+ background: #2885FF;
|
|
|
+ border-radius: 20px;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+<body>
|
|
|
+ <div id="box" class="box">
|
|
|
+ <!-- 数据查看 -->
|
|
|
+ <div class="page4">
|
|
|
+ <div class="data_box">
|
|
|
+ <div class="data_title">新增客户数量</div>
|
|
|
+ <div class="total_num">
|
|
|
+ <div>
|
|
|
+ <div class="total">{{countData.total}}</div>
|
|
|
+ <div class="des">累计新增客户</div>
|
|
|
+ </div>
|
|
|
+ <div class="data_line"></div>
|
|
|
+ <div>
|
|
|
+ <div class="total">{{countData.todayAdd}}</div>
|
|
|
+ <div class="des">今日新增客户</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="prize_list">
|
|
|
+ <div class="prize_title">
|
|
|
+ <image class="left_icon" src="./img/left.png"></image>
|
|
|
+ <span>我的奖品</span>
|
|
|
+ <image class="right_icon" src="./img/right.png"></image>
|
|
|
+ </div>
|
|
|
+ <div class="prize_item" v-for="(item, index) in countData.stimulateList" :key="index">
|
|
|
+ <div class="prize_des">
|
|
|
+ <div class="prize_item_title">
|
|
|
+ <span>{{item.complete ? '恭喜您已达成' : '未达成'}}</span>
|
|
|
+ <span style="color: #2885FF;">
|
|
|
+ <span v-if="item.rank===1">一等奖:</span>
|
|
|
+ <span v-if="item.rank===2">二等奖:</span>
|
|
|
+ <span v-if="item.rank===3">三等奖:</span>
|
|
|
+ <span>{{item.prizeName}}</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="prize_item_num" v-if="!item.complete">距离下一阶段奖励还差{{item.needNum}}人</div>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.complete">
|
|
|
+ <div class="prize_item_btn btn_no" @click="handlePrize(item)" v-if="item.accept===1">领取奖励</div>
|
|
|
+ <div class="prize_item_btn btn_ok" v-else>已领取</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-dialog title="填写收货信息" :visible.sync="showDialog">
|
|
|
+ <el-form :model="prizeMsg" class="prize_form" label-position="top">
|
|
|
+ <el-form-item label="收件人">
|
|
|
+ <el-input v-model="prizeMsg.name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="联系方式">
|
|
|
+ <el-input v-model="prizeMsg.phone"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="活动区域">
|
|
|
+ <el-input type="textarea" v-model="prizeMsg.address"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="handleSavePrize">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</body>
|
|
|
+<script>
|
|
|
+ new Vue({
|
|
|
+ el: '#box',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ httpUrl: '',
|
|
|
+ memberId: null,
|
|
|
+ corpId: null,
|
|
|
+ countData: {
|
|
|
+ stimulateList: [],
|
|
|
+ todayAdd: null,
|
|
|
+ total: null,
|
|
|
+ },
|
|
|
+ showDialog: false,
|
|
|
+ prizeMsg: {
|
|
|
+ name: '',
|
|
|
+ phone: '',
|
|
|
+ address: '',
|
|
|
+ stimulateId: null,
|
|
|
+ },
|
|
|
+ moneyData: {
|
|
|
+ money: null,
|
|
|
+ prizeCode: '',
|
|
|
+ urlQrCode: '',
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.httpUrl = this.getQueryParam('httpUrl')
|
|
|
+ this.corpId = this.getQueryParam('corpId')
|
|
|
+ this.memberId = this.getQueryParam('memberId')
|
|
|
+ this.showData()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 查看数据
|
|
|
+ showData () {
|
|
|
+ fetch(this.httpUrl + '/scrm/v1/wxcp-live-code-counselor/p/findCountByH5', {
|
|
|
+ method: 'post',
|
|
|
+ body: JSON.stringify({
|
|
|
+ corpId: this.corpId,
|
|
|
+ memberId: this.memberId,
|
|
|
+ }),
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ return res.json()
|
|
|
+ }).then(result => {
|
|
|
+ let { data, code, msg } = result
|
|
|
+ if (data) {
|
|
|
+ this.countData = data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 领取奖励
|
|
|
+ handlePrize (item) {
|
|
|
+ this.prizeMsg.stimulateId = item.stimulateId
|
|
|
+ if (item.acceptType === 1) {
|
|
|
+ // 表单
|
|
|
+ this.showDialog = true
|
|
|
+ } else if (item.acceptType === 2) {
|
|
|
+ // 红包
|
|
|
+ this.getRedMoney()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 保存填写的收货信息
|
|
|
+ handleSavePrize () {
|
|
|
+ fetch(this.httpUrl + '/scrm/v1/wxcp-live-code-counselor/p/receivePrizeByH5', {
|
|
|
+ method: 'post',
|
|
|
+ body: JSON.stringify({
|
|
|
+ corpId: this.corpId,
|
|
|
+ memberId: this.memberId,
|
|
|
+ ...this.prizeMsg
|
|
|
+ }),
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ return res.json()
|
|
|
+ }).then(result => {
|
|
|
+ let { data, code, msg } = result
|
|
|
+ if (data) {
|
|
|
+ this.showDialog = false
|
|
|
+ this.showData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 红包数据
|
|
|
+ getRedMoney () {
|
|
|
+ fetch(this.httpUrl + '/scrm/v1/wxcp-live-code-counselor/p/receiveMoneyByH5', {
|
|
|
+ method: 'post',
|
|
|
+ body: JSON.stringify({
|
|
|
+ corpId: this.corpId,
|
|
|
+ memberId: this.memberId,
|
|
|
+ ...this.prizeMsg
|
|
|
+ }),
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ return res.json()
|
|
|
+ }).then(result => {
|
|
|
+ let { data, code, msg } = result
|
|
|
+ if (data) {
|
|
|
+ // 跳转兑换页
|
|
|
+ window.location.href = `money.html?prizeCode=${data.prizeCode}&urlQrCode=${data.urlQrCode}`;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 截取url中的数据
|
|
|
+ getQueryParam (paramName) {
|
|
|
+ // 获取当前URL的查询字符串部分
|
|
|
+ const queryString = window.location.search;
|
|
|
+ // 创建一个URLSearchParams对象
|
|
|
+ const urlParams = new URLSearchParams(queryString);
|
|
|
+ // 返回指定参数的值,如果不存在则返回null
|
|
|
+ return urlParams.get(paramName);
|
|
|
+ },
|
|
|
+ }
|
|
|
+ })
|
|
|
+</script>
|
|
|
+
|
|
|
+</html>
|