| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394 |
- <!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,minimum-scale=1,maximum-scale=1,user-scalable=no, viewport-fit=cover" />
- <title>数据查看</title>
- <!--引入 element-ui 的样式,-->
- <link rel="stylesheet"
- href="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742018383195/element-ui.css">
- <!-- 必须先引入vue, 后使用element-ui -->
- <script
- src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017957144/vue.js"></script>
- <!-- 引入element 的组件库-->
- <script
- src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017747738/element-ui.js"></script>
- <!-- <script src="js/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">领取奖励</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
- } else {
- this.$message.error(msg)
- }
- })
- },
- // 领取奖励
- 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 (code === 1) {
- this.showDialog = false
- this.showData()
- } else {
- this.$message.error(msg)
- }
- })
- },
- // 红包数据
- 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>
|