index.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. <template>
  2. <view class="top-cont">
  3. <view class="content">
  4. <view class="user-info">
  5. <view class="left">
  6. <view class="name-phone">
  7. <view class="name">{{user.nickName}}</view>
  8. <view class="phone" v-if="user!=null">{{utils.parsePhone(user.phonenumber)}}</view>
  9. </view>
  10. </view>
  11. <view class="msg-box" >
  12. {{user.deptName}}
  13. </view>
  14. </view>
  15. <!-- 常用工具 -->
  16. <view class="used-tools">
  17. <view class="title">常用工具</view>
  18. <view class="tools-list">
  19. <view class="item" @click="toCreateOrder()">
  20. <image src="https://bjczwh.oss-cn-beijing.aliyuncs.com/app/shop/images/order.png" mode=""></image>
  21. <text class="text">商品制单</text>
  22. </view>
  23. <view class="item" @click="toCreateCoupon()">
  24. <image src="https://bjczwh.oss-cn-beijing.aliyuncs.com/app/shop/images/icon_coupon.png" mode=""></image>
  25. <text class="text">制单优惠券</text>
  26. </view>
  27. <view class="item" @click="toCreatejin()">
  28. <image src="https://bjczwh.oss-cn-beijing.aliyuncs.com/app/shop/images/xianjin.png" mode=""></image>
  29. <text class="text">制单立减金</text>
  30. </view>
  31. <view class="item" @click="toPay()">
  32. <image src="https://bjczwh.oss-cn-beijing.aliyuncs.com/app/shop/images/money.png" mode=""></image>
  33. <text class="text">微信收款</text>
  34. </view>
  35. <!-- <view class="item" @click="alipay()">
  36. <image src="https://bjczwh.oss-cn-beijing.aliyuncs.com/app/shop/images/money.png" mode=""></image>
  37. <text class="text">支付宝收款</text>
  38. </view> -->
  39. <view class="item" @click="toOrder()">
  40. <image src="https://bjczwh.oss-cn-beijing.aliyuncs.com/app/shop/images/order.png" mode=""></image>
  41. <text class="text">我的订单</text>
  42. </view>
  43. <!-- <view class="item" @click="toPackage()">
  44. <image src="https://bjczwh.oss-cn-beijing.aliyuncs.com/app/shop/images/package.png" mode=""></image>
  45. <text class="text">商品套餐</text>
  46. </view>
  47. <view class="item" @click="toCoupon()">
  48. <image src="https://bjczwh.oss-cn-beijing.aliyuncs.com/app/shop/images/icon_coupon.png" mode=""></image>
  49. <text class="text">套餐优惠券</text>
  50. </view> -->
  51. <view class="item" @click="toPaywechat()">
  52. <image src="https://zkzh-2025.oss-cn-beijing.aliyuncs.com/app/image/wechat.png" mode=""></image>
  53. <text class="text">微信收款码</text>
  54. </view>
  55. <view class="item" @click="toliushui()">
  56. <image src="https://bjczwh.oss-cn-beijing.aliyuncs.com/app/shop/images/liushui.png" mode=""></image>
  57. <text class="text">收款流水</text>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- 退出登录按钮 -->
  62. <view class="log-out" @click="logout">退出登录</view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import {getUserInfo,getQrImg} from '@/api/companyUser'
  68. export default {
  69. data() {
  70. return {
  71. user:null,
  72. };
  73. },
  74. onLoad() {
  75. console.log("onload")
  76. },
  77. onShow() {
  78. console.log("onshow")
  79. this.getUserInfo()
  80. },
  81. methods: {
  82. toCreatejin(){
  83. uni.navigateTo({
  84. url:'/pages_company/order/DirectDiscount?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  85. })
  86. },
  87. toliushui(){
  88. uni.navigateTo({
  89. url:'/pages_company/paymentStatistics?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  90. })
  91. },
  92. toPaywechat(){
  93. uni.navigateTo({
  94. url:'/pages_company/wechatcode?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  95. })
  96. },
  97. alipay(){
  98. // var url="http://alipay.yjf.runtzh.com/#/?companyId="+this.user.companyId+"&companyUserId="+this.user.userId
  99. // uni.setClipboardData({
  100. // data:url,
  101. // success:()=>{
  102. // uni.showToast({
  103. // title:'收款地址已复制到剪切板',
  104. // icon:'none'
  105. // })
  106. // }
  107. // });
  108. uni.navigateTo({
  109. url:'/pages_company/alipayImg'
  110. })
  111. },
  112. toCard(){
  113. uni.navigateTo({
  114. url:'/pages_company/card?cardId='+this.user.cardId
  115. })
  116. },
  117. toCreateOrder(){
  118. uni.navigateTo({
  119. url:'/pages_company/order/productList'
  120. })
  121. },
  122. toPay(){
  123. uni.navigateTo({
  124. url:'/pages_user/user/pay?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  125. })
  126. },
  127. toOrder(){
  128. uni.navigateTo({
  129. url:'/pages_company/storeOrder?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  130. })
  131. },
  132. toPackage(){
  133. uni.navigateTo({
  134. url:'/pages_company/storeProductPackage?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  135. })
  136. },
  137. toCoupon(){
  138. uni.navigateTo({
  139. url:'/pages_company/coupon'
  140. })
  141. },
  142. toCreateCoupon(){
  143. uni.navigateTo({
  144. url:'/pages_company/order/coupon'
  145. })
  146. },
  147. toCreateOrderCoupon(){
  148. uni.navigateTo({
  149. url:'/pages_company/order/coupon'
  150. })
  151. },
  152. getUserInfo(){
  153. var data={token:uni.getStorageSync('CompanyUserToken')}
  154. getUserInfo(data).then(
  155. res => {
  156. if(res.code==200){
  157. this.user=res.data;
  158. }
  159. else if(res.code==403){
  160. uni.setStorageSync('CompanyUserToken',null);
  161. uni.navigateBack({
  162. delta:-1
  163. })
  164. }else{
  165. uni.showToast({
  166. icon:'none',
  167. title: res.msg,
  168. });
  169. }
  170. },
  171. rej => {}
  172. );
  173. },
  174. logout(){
  175. uni.showModal({
  176. title:"提示",
  177. content:"确认退出登录吗?",
  178. showCancel:true,
  179. cancelText:'取消',
  180. confirmText:'确定',
  181. success:res=>{
  182. if(res.confirm){
  183. uni.setStorageSync('CompanyUserToken',null);
  184. uni.navigateBack({
  185. delta:-1
  186. })
  187. }else{
  188. }
  189. }
  190. })
  191. },
  192. // 跳转页面
  193. navgetTo(url) {
  194. this.utils.isLogin().then(res => {
  195. if(res){
  196. uni.navigateTo({
  197. url: url
  198. })
  199. }
  200. })
  201. },
  202. }
  203. }
  204. </script>
  205. <style lang="scss">
  206. .content{
  207. margin: 20upx 0upx;
  208. padding: 0 20upx;
  209. .user-info{
  210. padding: 30upx;
  211. display: flex;
  212. align-items: center;
  213. justify-content: space-between;
  214. .left{
  215. position: relative;
  216. display: flex;
  217. .head-img{
  218. width: 120upx;
  219. height: 120upx;
  220. border-radius: 50%;
  221. overflow: hidden;
  222. margin-right: 30upx;
  223. border: 4upx solid #FFFFFF;
  224. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  225. image{
  226. width: 100%;
  227. height: 100%;
  228. }
  229. }
  230. .name-phone{
  231. padding-top: 15upx;
  232. .name{
  233. font-size: 36upx;
  234. font-family: PingFang SC;
  235. font-weight: bold;
  236. color: #111111;
  237. line-height: 1;
  238. }
  239. .phone{
  240. font-size: 28upx;
  241. font-family: PingFang SC;
  242. font-weight: 500;
  243. color: #666666;
  244. line-height: 1;
  245. margin-top: 30upx;
  246. }
  247. }
  248. }
  249. .msg-box{
  250. padding: 5rpx 15upx;
  251. height: 30upx;
  252. line-height: 30upx;
  253. font-size: 22upx;
  254. font-family: PingFang SC;
  255. font-weight: 500;
  256. color: #FFFFFF;
  257. border-radius: 8rpx;
  258. background-color: #2BC7B9;
  259. }
  260. }
  261. .used-tools{
  262. box-sizing: border-box;
  263. background: #FFFFFF;
  264. border-radius: 16upx;
  265. padding: 40upx 30upx;
  266. .title{
  267. font-size: 32upx;
  268. font-family: PingFang SC;
  269. font-weight: bold;
  270. color: #222222;
  271. line-height: 1;
  272. }
  273. .tools-list{
  274. margin-top: 50upx;
  275. display: flex;
  276. flex-wrap: wrap;
  277. width: 100%;
  278. .item{
  279. box-sizing: border-box;
  280. width: 25%;
  281. display: flex;
  282. flex-direction: column;
  283. align-items: center;
  284. justify-content: center;
  285. margin-bottom: 50upx;
  286. position: relative;
  287. image{
  288. width: 44upx;
  289. height: 44upx;
  290. }
  291. .text{
  292. font-size: 24upx;
  293. font-family: PingFang SC;
  294. font-weight: 500;
  295. color: #111111;
  296. line-height: 1;
  297. margin-top: 20upx;
  298. }
  299. .contact-btn{
  300. display: inline-block;
  301. position: absolute;
  302. top: 0;
  303. left: 0;
  304. width: 100%;
  305. height: 100%;
  306. opacity: 0;
  307. }
  308. }
  309. }
  310. }
  311. .log-out{
  312. height: 80upx;
  313. line-height: 80upx;
  314. text-align: center;
  315. font-size: 26upx;
  316. font-family: PingFang SC;
  317. font-weight: 500;
  318. color: #666666;
  319. background: #FFFFFF;
  320. border-radius: 16upx;
  321. margin-top: 20upx;
  322. }
  323. }
  324. </style>