team.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <template>
  2. <view>
  3. <!--promote/team/team.wxml-->
  4. <view class="top">
  5. <view class="topc">
  6. <view class="info">
  7. <view class="userlogo">
  8. <image :src="info.avatar" mode="aspectFit" class="photo"></image>
  9. </view>
  10. <view class="infos">
  11. <view>{{info.nickName}}</view>
  12. <text v-if="info.state==1">审核中</text>
  13. <block v-if="info.state==2">
  14. <text v-if="user.pid == 0">手机号 {{user.mobile}}</text>
  15. <text v-else>推荐人 {{user.pname?user.pname:user.pid}}</text>
  16. </block>
  17. </view>
  18. <navigator url="/promote/invite/invite" hover-class="none" open-type="navigate" class="copy">
  19. <image src="../static/promote/images/ma.png"></image>
  20. 我要推广
  21. </navigator>
  22. <!-- <view class="thmbtn" @tap="showCode">
  23. <image src="/static/pages/images/ewmico.png"></image>
  24. </view> -->
  25. </view>
  26. <view class="shouyi">
  27. <view class="money">
  28. <view class="dflex qian">
  29. <view class="qians" @click="jumpUrl('/promote/withdrawal/income/income')">{{info.total?info.total:'0.00'}}<text>元</text></view>
  30. <text class="tixian" @tap="gotixian">立即提现</text>
  31. </view>
  32. <view class="dflex titleSet" @click="jumpUrl('/promote/withdrawal/income/income')">
  33. <view class="ye-text dflex">
  34. <image src="../static/promote/images/fxico1.png"></image>累计收益
  35. </view>
  36. </view>
  37. </view>
  38. <view class="m-datas ddflex">
  39. <view class="li" @click="jumpUrl('/promote/settleDetail/settleDetail?tabIndex=' + 1 + '&timeIndex=' + 0 + '&state=1')">
  40. <view><text>¥</text>{{info.wjMoney?info.wjMoney:'0.00'}}</view>待结算
  41. </view>
  42. <view class="li" @click="jumpUrl('/promote/settleDetail/settleDetail?tabIndex=' + 1 + '&timeIndex=' + 0 + '&state=2')">
  43. <view><text>¥</text>{{info.balance?info.balance:'0.00'}}</view>可提现
  44. </view>
  45. <view class="li" @click="jumpUrl('/promote/withdrawal/record/record')">
  46. <view><text>¥</text>{{info.cumulative?info.cumulative:'0.00'}}</view>累计提现
  47. </view>
  48. <!-- <view class="li">
  49. <view><text>¥</text>{{info.todayTotal? info.todayTotal : '0'}}</view>今日收益
  50. </view> -->
  51. <!-- <view class="li">
  52. <view><text>¥</text>{{total ? total : '0'}}</view>推广业绩
  53. </view> -->
  54. </view>
  55. </view>
  56. <!-- <view class="shouyi">
  57. <view class="money">
  58. <view class="dflex qian">
  59. <view class="qians">{{info.balance? info.balance : '0'}}<text>元</text></view>
  60. <text class="tixian" @tap="gotixian">立即提现</text>
  61. </view>
  62. <view class="dflex titleSet">
  63. <view class="ye-text dflex">
  64. 账户余额
  65. </view>
  66. </view>
  67. </view>
  68. <view class="status">
  69. <view class="li dflex">
  70. <view class="ye-text dflex">
  71. 待结算:{{info.wjMoney? info.wjMoney : '0'}}<text>元</text>
  72. </view>
  73. <view class="title" v-if="distr.commissionSettleTimE">
  74. <image src="../static/promote/images/tip.png" class="tip" @tap="titleShow"></image>
  75. <view class="hint" v-if="hint">
  76. <view>
  77. 订单签收确认后,待结算将自动转入账户余额
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="li">
  83. <view class="ye-text dflex">
  84. 累计收益:{{total ? total : '0'}}<text>元</text>
  85. </view>
  86. </view>
  87. </view>
  88. </view> -->
  89. </view>
  90. </view>
  91. <view class="myteam bgfff">
  92. <!-- <navigator :url="'/promote/teamList/teamList?tab=0&IS_secondary_members=' + IS_secondary_members" hover-class="none" class="titr"> -->
  93. <view class="titr">
  94. <view class="tit dflex">
  95. <view class="flex">我的业绩</view>
  96. <!-- <text>查看详情</text>
  97. <image src="/static/pages/images/more.png" class="rico"></image> -->
  98. </view>
  99. </view>
  100. <!-- </navigator> -->
  101. <view class="data dflex">
  102. <navigator :url="'/promote/teamList/teamList?tab=0&IS_secondary_members=' + IS_secondary_members" hover-class="none" class="li">
  103. <view>{{count.total ? count.total : '0'}}</view>所有客户
  104. </navigator>
  105. <navigator url="/promote/sales/sales" hover-class="none" class="li">
  106. <view><text>¥</text>{{info.salesVolume ? info.salesVolume : '0.00'}}</view>销售额
  107. </navigator>
  108. <navigator url="/promote/sales/sales" hover-class="none" class="li">
  109. <view>{{info.orderCount ? info.orderCount : '0'}}</view>成交订单
  110. </navigator>
  111. <navigator :url="'/promote/settleDetail/settleDetail?timeIndex=' + 5 + '&state=2'" hover-class="none" class="li">
  112. <view><text>¥</text>{{info.monthTotal ? info.monthTotal : '0.00'}}</view>本月收入
  113. </navigator>
  114. <!-- <block v-if="IS_secondary_members!=1">
  115. <navigator :url="'/promote/teamList/teamList?tab=0&IS_secondary_members=' + IS_secondary_members"
  116. hover-class="none" class="li"><text>{{count.total ? count.total : '0'}}</text>所有客户
  117. </navigator>
  118. <navigator url="/promote/teamList/teamList?tab=2" hover-class="none" class="li">
  119. <text>{{count.monthTotal ? count.monthTotal : '0'}}</text>本月新增
  120. </navigator>
  121. </block>
  122. <block v-else>
  123. <navigator :url="'/promote/teamList/teamList?tab=0&IS_secondary_members=' + IS_secondary_members"
  124. hover-class="none" class="li"><text>{{count.total ? count.total : '0'}}</text>一级成员
  125. </navigator>
  126. <navigator
  127. :url="'/promote/teamList/teamList?tab=1&IS_secondary_members=' + IS_secondary_members + '&isDirect=' + false"
  128. hover-class="none" class="li">
  129. <text>{{count.monthTotal ? count.monthTotal : '0'}}</text>二级成员
  130. </navigator>
  131. </block> -->
  132. </view>
  133. </view>
  134. <view class="mine-nav">
  135. <!-- <view class='li' @tap="isshop!=0?goshop():applyshop()" v-if="distr.distributionSmallShopOpen==1">
  136. <image src="../static/promote/images/fxico9.png" class="mineico"></image>
  137. <text>我的小店</text>
  138. <image src="/static/pages/images/more.png" class="rico"></image>
  139. </view> -->
  140. <navigator url="/promote/products/products" class="li" hover-class="none">
  141. <image src="../static/promote/images/fxico4.png" class="mineico"></image>
  142. <text>分销商品</text>
  143. <image src="/static/pages/images/more.png" class="rico"></image>
  144. </navigator>
  145. <navigator url="/promote/invite/invite" class="li" hover-class="none">
  146. <image src="../static/promote/images/fxico5.png" class="mineico"></image>
  147. <text>推广二维码海报</text>
  148. <image src="/static/pages/images/more.png" class="rico"></image>
  149. </navigator>
  150. <!-- <navigator url="/promote/balance/balance" class="li" hover-class="none">
  151. <image src="../static/promote/images/fxico6.png" class="mineico"></image>
  152. <text>业绩订单</text>
  153. <image src="/static/pages/images/more.png" class="rico"></image>
  154. </navigator> -->
  155. <navigator url="/promote/service/service" class="li" hover-class="none" v-if="user.listShopBase.length>0">
  156. <image src="../static/promote/images/fxico8.png" class="mineico"></image>
  157. <text>小店服务费</text>
  158. <image src="/static/pages/images/more.png" class="rico"></image>
  159. </navigator>
  160. <!-- <navigator url="/promote/withdrawal/record/record" class="li" hover-class="none">
  161. <image src="../static/promote/images/fxico7.png" class="mineico"></image>
  162. <text>提现记录</text>
  163. <image src="/static/pages/images/more.png" class="rico"></image>
  164. </navigator> -->
  165. </view>
  166. </view>
  167. </template>
  168. <script>
  169. // promote/team/team.js
  170. const app = getApp();
  171. const req = require("../../utils/request.js");
  172. export default {
  173. data() {
  174. return {
  175. isshow: 0,
  176. IS_secondary_members: 0,
  177. count: "",
  178. user: {},
  179. distr: "",
  180. condition: "",
  181. hint: false,
  182. info: {}
  183. };
  184. },
  185. components: {},
  186. props: {},
  187. onLoad() {
  188. this.isshop()
  189. },
  190. onShow() {
  191. uni.setNavigationBarColor({
  192. frontColor: '#ffffff',
  193. backgroundColor: req.public.titleTopBgColor
  194. });
  195. this.getuser();
  196. if (JSON.parse(req.getStorage('configRes')).IS_secondary_members) {
  197. let IS_secondary_members = JSON.parse(req.getStorage('configRes')).IS_secondary_members;
  198. this.setData({
  199. IS_secondary_members: IS_secondary_members
  200. });
  201. }
  202. },
  203. onHide() {
  204. this.hint = false
  205. },
  206. methods: {
  207. getData() {
  208. req.getRequest('/api/distribution/info?v=1.2', {}, data => {
  209. // data.info.nickName = req.excludeSpecial(data.info.nickName);
  210. this.info = data;
  211. // this.setData(data);
  212. // console.log(this, "yyyyyyyyyyyyyy", data);
  213. });
  214. },
  215. titleShow() {
  216. this.hint = !this.hint
  217. },
  218. getCount() {
  219. req.getRequest('/api/distribution/partner/count', {}, data => {
  220. this.setData({
  221. count: data
  222. });
  223. });
  224. },
  225. // Promise.all([this.getuser])
  226. //获取用户个人中心的信息
  227. getuser() {
  228. req.getRequest('/api/user/info', {}, res => {
  229. this.setData({
  230. user: res
  231. });
  232. // console.log(this, "qqqq", res);
  233. // if (req.getStorage('distribution')) {
  234. // let dist = req.getStorage('distribution');
  235. // this.setData({
  236. // distr: dist
  237. // });
  238. // console.log(dist);
  239. // if (dist.distributionApply == 0) {
  240. // this.apply();
  241. // } else {
  242. // this.getData();
  243. // this.getCount();
  244. // }
  245. // let user = this.user;
  246. // let arr = [];
  247. // if (dist.distributionNeedParam.indexOf('1') != -1) {
  248. // if (user.nickName = '') {
  249. // arr.push("姓名");
  250. // }
  251. // }
  252. // if (dist.distributionNeedParam.indexOf('2') != -1) {
  253. // console.log(user.mobile);
  254. // if (user.mobile == null) {
  255. // arr.push("电话");
  256. // }
  257. // }
  258. // if (dist.distributionNeedParam.indexOf('3') != -1) {
  259. // if (user.cardNo == null) {
  260. // arr.push("身份证号码");
  261. // }
  262. // }
  263. // if (dist.distributionNeedParam.indexOf('5') != -1) {
  264. // console.log(res.birthday);
  265. // if (user.birthday == null) {
  266. // arr.push("生日");
  267. // }
  268. // }
  269. // if (dist.distributionNeedParam.indexOf('6') != -1) {
  270. // if (user.gender == '') {
  271. // arr.push("性别");
  272. // }
  273. // }
  274. // this.setData({
  275. // condition: arr
  276. // });
  277. // if (arr.length > 0) {
  278. // this.getshow();
  279. // }
  280. // } else {
  281. req.postRequest('/api/distribution/config', {}, res => {
  282. this.setData({
  283. distr: res
  284. });
  285. if (res.distributionApply == 0 && this.user.isDistriUser == 0) {
  286. this.apply();
  287. } else {
  288. this.getData();
  289. this.getCount();
  290. }
  291. let user = this.user;
  292. let arr = [];
  293. if (res.distributionNeedParam.indexOf('1') != -1) {
  294. if (user.nickName = '') {
  295. arr.push("姓名");
  296. }
  297. }
  298. if (res.distributionNeedParam.indexOf('2') != -1) {
  299. // console.log(user.mobile);
  300. if (user.mobile == null) {
  301. arr.push("电话");
  302. }
  303. }
  304. if (res.distributionNeedParam.indexOf('3') != -1) {
  305. if (user.cardNo == null) {
  306. arr.push("身份证号码");
  307. }
  308. }
  309. if (res.distributionNeedParam.indexOf('5') != -1) {
  310. // console.log(user.birthday);
  311. if (user.birthday == null) {
  312. arr.push("生日");
  313. }
  314. }
  315. if (res.distributionNeedParam.indexOf('6') != -1) {
  316. if (user.gender == '') {
  317. arr.push("性别");
  318. }
  319. }
  320. this.setData({
  321. condition: arr
  322. });
  323. if (arr.length > 0) {
  324. this.getshow();
  325. }
  326. });
  327. // }
  328. });
  329. },
  330. //对话框
  331. getshow() {
  332. uni.showModal({
  333. title: '提示',
  334. content: '请您先完善必要的信息:' + this.condition,
  335. confirmText: '去完善',
  336. success(res) {
  337. if (res.confirm) {
  338. uni.redirectTo({
  339. url: "/mine/userinfo/userinfo"
  340. });
  341. } else if (res.cancel) {
  342. uni.switchTab({
  343. url: "/pages/user/user"
  344. });
  345. }
  346. }
  347. });
  348. },
  349. gotixian() {
  350. uni.navigateTo({
  351. url: '/promote/withdrawal/index/index'
  352. });
  353. },
  354. apply() {
  355. // console.log(this.distr);
  356. req.postRequest('/api/distribution/applymap', {
  357. distributionApply: this.distr.distributionApply
  358. }, data => {
  359. // console.log(data);
  360. this.getData();
  361. this.getCount();
  362. });
  363. },
  364. // 去小店
  365. goshop() {
  366. wx.navigateTo({
  367. url: '/mine/shop/shop?shopId=' + this.user.listShopBase[0].id+'&merchantId='+this.user.listShopBase[0].merchant_id
  368. })
  369. },
  370. // 申请小店
  371. applyshop() {
  372. req.postRequest('/api/shopBase/save', {}, data => {
  373. req.msg("申请成功,等待管理员同意")
  374. this.isshop()
  375. })
  376. },
  377. // 是否已经拥有小店
  378. isshop() {
  379. req.postRequest('/api/shopBase/isOpenShop', {}, data => {
  380. this.setData({
  381. isshop: data
  382. })
  383. console.log(data)
  384. })
  385. },
  386. jumpUrl(url){
  387. uni.navigateTo({
  388. url: url
  389. })
  390. }
  391. }
  392. };
  393. </script>
  394. <style>
  395. @import "./team.css";
  396. </style>