addStaff.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. <template>
  2. <view>
  3. <public-module></public-module>
  4. <!-- <service-widget @btnClick="btn_click"></service-widget> -->
  5. <view class="headers dis a-c j-start " :style="headerStyle">
  6. <u-icon name="arrow-left" size="40" @tap="back"></u-icon>
  7. <text style="margin: auto;">我的邀请码</text>
  8. </view>
  9. <view class="Personnel dis a-c j-s">
  10. </view>
  11. <view class="" style="padding: 16px;margin-top: -78px;">
  12. <view class="promotion " v-if="sources==1">
  13. <view style="border-bottom: 1px solid #f2f2f2;">
  14. <u-tabs :list="list" :is-scroll="false" :current="current" @change="change"
  15. style="background: transparent;width: 210px;" :active-item-style="activestyle"
  16. inactive-color="#81869B" bar-width="80"></u-tabs>
  17. </view>
  18. <view class="dis a-c j-c f-c " v-if="current==0">
  19. <view class="" style="position: relative;margin: 40px 0;">
  20. <image :src="recommendImg" mode="widthFix" lazy-load style="width: 110px;height: 110px;">
  21. </image>
  22. <image src="../../../static/image/addStaff/zgcx.png" mode=""
  23. style="width: 26px;height: 26px;position: absolute;top: 50%;left: 50%; transform: translate(-50%, -50%);">
  24. </image>
  25. </view>
  26. <view class="shareMethod dis a-c j-s ">
  27. <view class="dis f-c a-c" @click="save">
  28. <image src="../../../static/image/addStaff/saveimg.png" mode=""></image>
  29. <text>保存图片</text>
  30. </view>
  31. <view class="dis f-c a-c" @click="invitation">
  32. <image src="../../../static/image/addStaff/share.png" mode=""></image>
  33. <text>分享海报</text>
  34. </view>
  35. <view class="dis f-c a-c" @click="linkShare(recommendUrl)">
  36. <image src="../../../static/image/addStaff/urlshare.png" mode=""></image>
  37. <text>链接分享</text>
  38. </view>
  39. <!-- #ifdef APP -->
  40. <view class="dis f-c a-c" @click="smsShare(recommendUrl)">
  41. <image src="../../../static/image/addStaff/smsshare.png" mode=""></image>
  42. <text>短信分享</text>
  43. </view>
  44. <!-- #endif -->
  45. </view>
  46. </view>
  47. <view class="dis a-c j-c f-c " v-if="current==1">
  48. <view class="qodeurl dis j-c a-c">
  49. <text>{{Downloadurl}}</text>
  50. </view>
  51. <view class="btn mt-4" @click="downloadUrl(Downloadurl)">
  52. <text>复制链接</text>
  53. </view>
  54. <view class="tioop dis a-c j-c">
  55. <text>下载APP,请点击复制链接后发送给好友,然后使用浏览器访问。</text>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="promotion " v-if="sources==2">
  60. <view style="border-bottom: 1px solid #f2f2f2;">
  61. <u-tabs :list="list1" :is-scroll="false" :current="current1" @change="change1"
  62. style="background: transparent;width: 150px;" :active-item-style="activestyle"
  63. inactive-color="#81869B" bar-width="80"></u-tabs>
  64. </view>
  65. <view class="dis a-c j-c f-c " v-if="current1==0">
  66. <view class="" style="position: relative;margin: 40px 0;">
  67. <image :src="orderissuerImg" mode="widthFix" lazy-load style="width: 110px;height: 110px;">
  68. </image>
  69. <image src="../../../static/image/addStaff/zgcx.png" mode=""
  70. style="width: 26px;height: 26px;position: absolute;top: 50%;left: 50%; transform: translate(-50%, -50%);">
  71. </image>
  72. </view>
  73. <view class="shareMethod dis a-c j-s ">
  74. <view class="dis f-c a-c" @click="save">
  75. <image src="../../../static/image/addStaff/saveimg.png" mode=""></image>
  76. <text>保存图片</text>
  77. </view>
  78. <view class="dis f-c a-c" @click="linkShare(orderissuerUrl)">
  79. <image src="../../../static/image/addStaff/urlshare.png" mode=""></image>
  80. <text>链接分享</text>
  81. </view>
  82. <!-- #ifdef APP -->
  83. <view class="dis f-c a-c" @click="smsShare(orderissuerUrl)">
  84. <image src="../../../static/image/addStaff/smsshare.png" mode=""></image>
  85. <text>短信分享</text>
  86. </view>
  87. <!-- #endif -->
  88. </view>
  89. </view>
  90. <view class="dis a-c j-c f-c " v-if="current1==1">
  91. <view class="qodeurl dis j-c a-c">
  92. <text>{{Downloadurl}}</text>
  93. </view>
  94. <view class="btn mt-4" @click="downloadUrl(Downloadurl)">
  95. <text>复制链接</text>
  96. </view>
  97. <view class="tioop dis a-c j-c">
  98. <text>下载APP,请点击复制链接后发送给好友,然后使用浏览器访问。</text>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="myMembers dis a-c j-s" @click="getStaffList">
  103. <view class="dis a-c">
  104. <image src="../../../static/image/addStaff/kefu.png" mode=""></image>
  105. <view class="dis f-c a-start">
  106. <text>我的成员</text>
  107. <text>查看成员已认证、未认证以及详细信息</text>
  108. </view>
  109. </view>
  110. <view class="circle dis a-c j-c">
  111. <u-icon name="arrow-right" color="#fff" size="26"
  112. :custom-style="{marginLeft:'2px',marginTop:'2px'}"></u-icon>
  113. </view>
  114. </view>
  115. <view class="myMembers1 dis a-c j-s" @click="newStats" v-if="this.userInfo.sysUser.managementSource == '2'">
  116. <view class="dis a-c">
  117. <image src="../../../static/image/addStaff/add.png" mode=""></image>
  118. <view class="dis f-c a-start">
  119. <text>新增统计</text>
  120. <text>查看成员新增数据的内容统计</text>
  121. </view>
  122. </view>
  123. <view class="circle dis a-c j-c">
  124. <u-icon name="arrow-right" color="#fff" size="26"
  125. :custom-style="{marginLeft:'2px',marginTop:'2px'}"></u-icon>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. </template>
  131. <script>
  132. import {
  133. mapState
  134. } from "vuex"
  135. import {
  136. pathToBase64,
  137. base64ToPath
  138. } from '@/common/pdf.js'
  139. import QR from "@/common/wxqrcode.js"
  140. export default {
  141. data() {
  142. return {
  143. Downloadurl: "", //app下载链接
  144. recommendImg: "",
  145. recommendUrl: "", //注册链接
  146. orderissuerImg: '',
  147. orderissuerUrl: "",
  148. list1: [{
  149. name: '邀请注册'
  150. }, {
  151. name: 'APP下载'
  152. }],
  153. current: 0,
  154. list: [{
  155. name: '出单员扫码注册'
  156. }, {
  157. name: 'APP下载'
  158. }, ],
  159. current1: 0,
  160. headerStyle: {
  161. backgroundColor: '',
  162. backgroundImage: '',
  163. backgroundSize: '',
  164. backgroundPosition: '',
  165. boxShadow: ''
  166. // 其他样式属性...
  167. },
  168. activestyle: {
  169. background: 'linear-gradient(to right, #52C7E0, #2B91EF)',
  170. backgroundClip: 'text',
  171. WebkitBackgroundClip: 'text',
  172. WebkitTextFillColor: 'transparent', // 透明填充颜色
  173. transition: 'background 0.3s ease', // 添加过渡效果
  174. }
  175. }
  176. },
  177. onLoad() {
  178. this.recommendCode();
  179. this.codeDownload();
  180. this.orderissuer();
  181. this.$http.get('/sysMenuRecord/add?type=1&menuType=4')
  182. // #ifdef APP
  183. if (window.plus) {
  184. plusReady();
  185. }
  186. //#endif
  187. },
  188. computed: {
  189. ...mapState(['userInfo', 'sources']),
  190. },
  191. methods: {
  192. //保存图片
  193. save() {
  194. let url = this.sources == '1' ? this.recommendImg : this.orderissuerImg;
  195. let base64Data = url.replace("data:image/gif;base64,", "");
  196. let pdfBase64 = `data:image/png;base64,${base64Data}`;
  197. base64ToPath(pdfBase64)
  198. .then(path => {
  199. uni.saveImageToPhotosAlbum({ //保存图片到系统相册。
  200. filePath: path, //图片文件路径
  201. success: function() {
  202. uni.showToast({
  203. title: '已保存到相册',
  204. icon: 'none',
  205. });
  206. },
  207. fail: function(e) {
  208. uni.showToast({
  209. title: '图片保存失败',
  210. icon: 'none',
  211. });
  212. }
  213. });
  214. })
  215. },
  216. downloadUrl(value) {
  217. uni.setClipboardData({
  218. data: value, //要被复制的内容
  219. success: () => { //复制成功的回调函数
  220. uni.showToast({ //提示
  221. icon: 'none',
  222. title: '链接复制成功'
  223. })
  224. }
  225. });
  226. },
  227. //链接分享
  228. linkShare(value) {
  229. uni.setClipboardData({
  230. data: value, //要被复制的内容
  231. success: () => { //复制成功的回调函数
  232. uni.showToast({ //提示
  233. icon: 'none',
  234. title: '邀请链接已复制成功'
  235. })
  236. }
  237. });
  238. },
  239. //编辑短信加载事件
  240. plusReady() {},
  241. //短信分享
  242. smsShare(value) {
  243. var msg = plus.messaging.createMessage(plus.messaging.TYPE_SMS);
  244. msg.to = [""];
  245. msg.body = `${this.userInfo.sysUser.name}向您发送来了加入团队的邀请,点击加入:%${value}%`;
  246. plus.messaging.sendMessage(msg);
  247. },
  248. btn_click() {
  249. uni.navigateTo({
  250. url: '/pages/chat/chat'
  251. })
  252. },
  253. //页面返回按钮
  254. back() {
  255. uni.navigateBack({
  256. delta: 1, // 返回的页面数,如果是1表示返回上一页
  257. success: function() {}
  258. });
  259. },
  260. invitation() {
  261. this.navigate({
  262. url: '/pages/tools/poster/poster',
  263. }, "navigateTo", true)
  264. },
  265. recommendCode() {
  266. let id = this.userInfo.sysUser.id;
  267. this.recommendImg = QR.createQrCodeImg(this.$base.h5BaseUrl + "/#/pages/register/register?id=" + id, {
  268. size: parseInt(200) //二维码大小
  269. })
  270. this.recommendUrl = this.$base.h5BaseUrl + "/#/pages/register/register?id=" + id;
  271. // this.recommendUrl = "http://192.168.0.20/h5/#/pages/register/register?id=" + id;
  272. },
  273. async codeDownload() {
  274. let id = this.userInfo.sysUser.id;
  275. let pageRequest = {
  276. pageNum: 1,
  277. pageSize: 50,
  278. columnFilters: {
  279. apptype: {
  280. name: "apptype",
  281. value: "apk",
  282. },
  283. appid: {
  284. name: "appid",
  285. value: "__UNI__D4FE29A",
  286. }
  287. }
  288. };
  289. let getquote = await this.$http.post('/sysVersion/findPage', pageRequest);
  290. let url = getquote.data.content[0].path;
  291. this.Downloadurl = url;
  292. },
  293. orderissuer() {
  294. let id = this.userInfo.sysUser.id;
  295. this.orderissuerImg = QR.createQrCodeImg(this.$base.h5BaseUrl + "/#/pages/register/orderissuer?id=" + id, {
  296. size: parseInt(200) //二维码大小
  297. })
  298. this.orderissuerUrl = this.$base.h5BaseUrl + "/#/pages/register/orderissuer?id=" + id;
  299. // this.orderissuerUrl = "http://192.168.0.20/h5/#/pages/register/orderissuer?id=" + id;
  300. },
  301. change(index) {
  302. this.current = index;
  303. },
  304. change1(index) {
  305. this.current1 = index;
  306. },
  307. getStaffList() {
  308. this.navigate({
  309. url: '/pages/tools/addStaff/authentication',
  310. }, "navigateTo", true);
  311. },
  312. newStats() {
  313. this.navigate({
  314. url: '/pages/tools/addStaff/employeeAdditionCount',
  315. }, "navigateTo", true);
  316. },
  317. }
  318. }
  319. </script>
  320. <style lang="scss" scoped>
  321. /deep/ {
  322. .u-tab-bar {
  323. background: linear-gradient(90deg, rgba(82, 199, 224, 1), rgba(43, 145, 239, 1)) !important;
  324. border-radius: 4px 4px 4px 4px;
  325. }
  326. .u-tab-item {}
  327. }
  328. page {
  329. background-color: #fff;
  330. }
  331. // 扫码注册下载
  332. .promotion {
  333. width: 100%;
  334. height: auto;
  335. background: #FFFFFF;
  336. box-shadow: 0px 4px 10px 0px #DAE3F4;
  337. border-radius: 6px;
  338. padding: 0 16px 16px;
  339. .shareMethod {
  340. width: 100%;
  341. >view {
  342. text {
  343. color: #999;
  344. font-size: 12px;
  345. margin-top: 4px;
  346. }
  347. image {
  348. width: 38px;
  349. height: 38px;
  350. }
  351. }
  352. }
  353. .qodeurl {
  354. padding: 5px 10px;
  355. border: 1px solid #EEEEEE;
  356. border-radius: 2px;
  357. margin-top: 36px;
  358. text {
  359. white-space: normal;
  360. word-wrap: break-word;
  361. word-break: break-all;
  362. text-align: center;
  363. /* 文本居中 */
  364. color: #666;
  365. font-size: 13px;
  366. }
  367. }
  368. .btn {
  369. background: linear-gradient(90deg, #0153FF 0%, #0D89FF 100%);
  370. box-shadow: 0px 2px 5px 0px rgba(0, 82, 255, 0.1);
  371. border-radius: 4px;
  372. padding: 5px 40px;
  373. margin-bottom: 48px;
  374. text {
  375. font-size: 13px;
  376. color: #fff;
  377. }
  378. }
  379. .tioop {
  380. background: #F9FAFB;
  381. border-radius: 2px;
  382. padding: 5px 10px;
  383. border: 1px solid #EEEEEE;
  384. text-align: center;
  385. color: #333;
  386. font-size: 12px;
  387. }
  388. }
  389. // 扫码注册下载
  390. // 我的成员 统计
  391. .myMembers,
  392. .myMembers1 {
  393. height: 60px;
  394. background: linear-gradient(90deg, #F3F8FF 0%, #DCF0FF 100%);
  395. box-shadow: 0px 2px 5px 0px #DAE3F4;
  396. border-radius: 6px;
  397. margin-top: 16px;
  398. padding: 10px;
  399. image {
  400. width: 40px;
  401. height: 40px;
  402. margin-right: 6px;
  403. }
  404. text:nth-child(1) {
  405. color: #536674;
  406. font-size: 15px;
  407. font-weight: bold;
  408. }
  409. text:nth-child(2) {
  410. color: #999999;
  411. font-size: 12px;
  412. }
  413. .circle {
  414. width: 24px;
  415. height: 24px;
  416. background: linear-gradient(175deg, #3793FF 0%, #0175FF 100%);
  417. box-shadow: 0px 2px 2px 0px rgba(0, 133, 255, 0.15);
  418. border-radius: 50%;
  419. }
  420. }
  421. .myMembers1 {
  422. background: linear-gradient(90deg, #FFFAF4 0%, #FFEDDD 100%);
  423. .circle {
  424. background: linear-gradient(175deg, #FFBB37 0%, #FF8A00 100%);
  425. }
  426. }
  427. // 我的成员 统计
  428. .Personnel {
  429. height: 177px;
  430. width: 100%;
  431. background-image: url("/static/image/addStaff/banner.png");
  432. background-size: 100% 100%;
  433. }
  434. .headers {
  435. position: fixed;
  436. top: 0;
  437. left: 0;
  438. height: auto;
  439. width: 100%;
  440. z-index: 999999;
  441. padding: 16px;
  442. padding-top: 50px;
  443. text {
  444. font-size: 18px;
  445. font-weight: bold;
  446. color: #000;
  447. }
  448. }
  449. .addStaffManage {
  450. height: 220upx;
  451. margin: 0 40upx;
  452. }
  453. .addStaffManage>view>view.icon {
  454. width: 110upx;
  455. height: 110upx;
  456. color: #FFFFFF;
  457. border-radius: 100%;
  458. margin-bottom: 10upx;
  459. font-size: 60upx;
  460. }
  461. .addStaffManage>view:nth-of-type(1)>view.icon {
  462. background-color: #78CBFF;
  463. }
  464. .addStaffManage>view:nth-of-type(2)>view.icon {
  465. background-color: #78FF7E;
  466. }
  467. .addStaffManage>view:nth-of-type(3)>view.icon {
  468. background-color: #FF9D4A;
  469. }
  470. </style>